Jump to content

Punctuation rule?


Tattoued

Recommended Posts

So I have 3 fields of designations that go after a rep's name. There are 3 optional designations. If the second or third column in the csv file is empty, I don't want a comma at the end. I've gotten as far as this:

 

if (Field("Designation 2") == "")

return ""

else

return Field("Designation 2")+", ";

if (Field("Designation 3") == "")

return Field("Designation 2")

 

This works for the first two designations, but if the 3rd designation is empty, it's still putting the comma after the 2nd, which I do not want. Shouldn't the above do the trick? In my logic (scary, I know), I'm thinking that this should work as the rule for designation 2. Perhaps I need to give the code more info to be able to "see" that I'm giving a directive to NOT use the comma if the 3rd designation is empty? And if the only designation is just position 1, I don't want a comma after that either...

 

Thanks again! You guys ROCK

 

I think I got it!!! From what I can see, this will work. In cases where there would be just one designation in position 1, I used this code and it SEEMS to work as long as there isn't any designations in position 2. If there IS something in "Designation 2", then I want the comma to be present:

 

if (Field("Designation 2") == "")

return Field("Designation 1");

else

return Field("Designation 1")+", "

 

Is that right?

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...