On 5/2/08 14:54, "jef chippewa" <[EMAIL PROTECTED]> wrote:

> i guess there would be two possible solutions:
> - add the needed zeros directly in PHOTOS
> - add the needed zeros in the PHOTOS IN HTML calc
> 
> i really prefer the second, since searching in
> the field with the first solution would require
> also typing the zeros.

Well the method I use to pad out a string to a length of four with zeros is
this:

Right("0000" & Photos, 4)

In your case I'm not completely clear what data is in Photos nor what the
end result should be (your calculation is given in some kind of shorthand).
It looks like you want a multi-line result. Given that you are going to end
up with a number of substitutes and other text functions involved, I think
I'd go at this (at least in the first instance) by breaking down the calc
into parts. You might, to preserve your sanity as you review the
calculations, create a separate calc field for each part. There's no great
harm in that, and it makes easier 'reading' when you come back to it later.

So extract the first photo from Photos using something like (untested):

Photo1 = Left(Photos, Position (Photos, ";", 1, 1) - 1)

If all of your Photos entries are exactly in the same form, this should
return [55 (C)]

Now you have to take this apart. You might use the LeftWords and RightWords
functions (though the parentheses may give problems). Alternatively, you
could determine the position of the space [Position(Photo1, " ", 1, 1)] and
base your calculation on that.

Anyway, the basic idea is to take the first 'word' [55] and run the padding
function on that. Then join this back up with the second word [(C)].

All in all, this is not so hard, but it does involve quite a lot of text
calculation. I wonder really why you seem to have multiple photo names
stored in the one field. Likely this would be much easier if your PHOTOS
field contained only one data point. And it would be easier still if you
separated PHOTOS out into two fields, for the number part and the letter
suffix. You could put them together in a calculation (for searching), but
you'd have a lot more flexibility in putting together your html.

Well, sorry that's not a full answer. I think you'd need to give the exact
calculation if you want that. But maybe it will help you see the options.

Steve

Reply via email to