Jump to content


Photo

Need help with value switch


  • Please log in to reply
4 replies to this topic

#1 robertjacobs0

robertjacobs0

    Advanced Member

  • Members
  • PipPipPip
  • 211 posts

Posted 20 December 2016 - 03:22 PM

A lot of events in my data took place in the Bronx. What I am trying to do is write a sentence template which will return "in the Bronx" for events which took place there but omit the "the" for events which took place elsewhere.

 

For the Bronx: < in the [place:first:plain]>

Elsewhere:      < in [place:first:plain]>

 

Can the value switch be used to make that discrimination? I recognize it as an if-then-else construction, but I don't see how to do it in RootsMagic.

 

All suggestions gratefully received!

 

 

Robert

 



#2 Bob C

Bob C

    Advanced Member

  • Members
  • PipPipPip
  • 192 posts

Posted 20 December 2016 - 04:38 PM

Have  you seen TomH's post at the end of this topic? It gives a good explanation of nested ifs.

 

http://forums.rootsm...rk-as-expected/



#3 robertjacobs0

robertjacobs0

    Advanced Member

  • Members
  • PipPipPip
  • 211 posts

Posted 20 December 2016 - 04:55 PM

Thank you, Bob. I had seen Tom's post. My problem is how to set X in <?[X]|a|b> to recognize "Bronx."

 

The construction I need is essentially

 

if [place:first] = "Bronx" then do A else do B

 

I should be able to do that but the precise technique seems to elude me.

 

All good wishes.

 

 

 

Robert



#4 TomH

TomH

    Advanced Member

  • Members
  • PipPipPip
  • 5859 posts

Posted 21 December 2016 - 01:27 PM

There is no value test of the sort IF X = 'abc' in the RM sentence template language. It has been requested long ago...


Tom user of RM7550 FTM2017 Ancestry.ca FamilySearch.org FindMyPast.com
SQLite_Tools_For_Roots_Magic_in_PR_Celti wiki, exploiting the database in special ways >>> Rmtrix_tiny.png app, a bundle of RootsMagic utilities.


#5 robertjacobs0

robertjacobs0

    Advanced Member

  • Members
  • PipPipPip
  • 211 posts

Posted 22 December 2016 - 08:57 AM

Thank you, Tom. I feared that that was the case. The news means many additional hours of work for me.

 

If I'd known seventy years ago I would have tried to get my folks to move the family to Brooklyn. Easier syntax today and closer to Ebbetts Field then :)

 

Thanks again -- warm Christmas and New Years wishes to you.

 

 

Robert