Help w. procedure


#1

In my photo database where each record contains the pertinent data of each shot there are also thumbnail .jpgs of each picture appearing. This works fine with the following procedure:

“1974 thumbs ƒ/”+TP+«R-NO»+YR

where “1953 thumbs ƒ/” is the folder with the jpgs and TP+«R-NO»+YR the image title. (this saves me entering hundreds of individual image titles, this procedure puts the titles together from available data in 3 fields of the record.

Now, there are cases where I made an error in the numbering of pictures. In stead of correcting all the subsequent numbers I leave the following numbers alone and have an extra field ES which in these cases contains a corrective number, e.g. .1, .2, etc. They are normally not more than 2-3 records, so the ES field is normally empty. It contains a number only if there was a correction in the image numbers.

So, in analogy to the above procedure I’d like to reformulate the procedure with an IF statement: if ES is empty, follow the above naming procedure (in most cases), else, if ES is not empty, get the image:

“1974 thumbs ƒ/”+TP+«R-NO»+ES+YR

What would the statement in Pano X be for “ES is not empty”? I did not succeed in putting the right formula together, but I am not a programming genius.


#2

Ooops! Sorry, the years in the folder name should be the same, 1974 in this case.


#3

It’s not clear to me what the data types are for these fields. I’m assuming that «R-NO» and ES are both numeric, because that’s only way I can see ES as a corrective number.

If a numeric field is blank, its value is zero, so adding it to a number will have no effect. You don’t need to test to see if it’s empty, just go ahead and add it regardless.

"1974 thumbs ƒ/"+TP+(«R-NO»+ES)+YR

I added the parentheses so that «R-NO»+ES will be numerical addition, rather than concatenation of text. Otherwise they would each be converted to text and concatenated with the text to their left. This way they get added together first, then the sum is converted to text and concatenated. Again, I’m assuming those are numeric fields.


#4

Looking at this again, with a fresh set of eyes, it makes just as much sense to me if «R-NO» and ES are both text. Concatenating an empty text field also has no effect. If they are both text, there is still no need to test to see if ES is empty. If they are both text, there is also no need for the parentheses, but they won’t do any harm either.


#5

Dave, thanks for delving into this. The field R-NO (=running number) is integer, the field ES (=error suffix) is text, because of the input form: .1 or .2 etc.
Your reasoning is logical - I just didn’t think it in this simple way - and it works after having tried it. So there is no IF-ELSE, just plain
"1974 thumbs ƒ/"+TP+«R-NO»+ES+YR+".jpg"
Your help was great, thanks!