Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5662 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm guessing the answer is fairly obvious (or else I'm making this too complicated), but ...

I have two fields, field1 and field2. I have another field, whichField, which uses a value list containing field1 and field2, so that the user can select a field on which to perform an operation in a script.

In the script, I want to get the value of the field1 or field2 (in the active record) being referred to by whichField.

If whichField is set to field1, and field1 (in the active record) contains "cat", I want to get that value.

I've looked in the functions, but am either overlooking something, or am thinking about this the wrong way.

Posted (edited)

That is it!

I'm building an interface where the user enters the number of characters desired to be padded out with leading zeros, and then chooses which field to be padded, using a field "whichField", which has a pop up value list of the possible fields to choose from. E.g., if the desired padding # is 8, and the field to be padded is "345678", I want the result to be "00345678"). Thank you.

Update (pardon for changing the subject).

When I run an 'Exit Loop If' using:

Length ( $leadingZerosText ) + Length ( GetField ( AddLeadingZeros::WhichField ) ) = Length ( AddLeadingZeros::DesiredStringLengthOfField )

... and the results get to (after some looping) '2+6=8', the loop doesn't exit. Even if I change to ≠. If I run "2+6=8" it exits.

Ken

Edited by Guest
Posted

I don't think I can answer that without seeing the entire picture.

BTW, you do not need a script to pad a field (as it seems you are doing). A simple calculation like =

Right ( "000000000000" & text ; targetLength )

should be quite sufficient.

You can also use =

Substitute ( 10^n -1 ; "9" ; "0" )

to generate a string of zeros of arbitrary length (up to 404).

This topic is 5662 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.