July 14, 200916 yr 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.
July 14, 200916 yr I am not sure what you're hoping to accomplish by this arrangement, but look (carefully) at the GetField() function.
July 21, 200916 yr Author 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 July 21, 200916 yr by Guest
July 21, 200916 yr 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).
Create an account or sign in to comment