jjfcpa Posted September 26, 2010 Posted September 26, 2010 I have a script that can process one of five fields. What I want to do is use a parameter to specify which field needs to be processed by passing a 1 to 5 and then storing the parameter to a local variable. Then I want to use the Replace Field Contents script step to replace the field specified to a 1 or 0. For example, I have the following fields: Field1 Field2 Field3 Field4 Field5 The field number variable is $FieldNumber. It looks like I have to select the field that I want to change instead of using the following: Evaluate( "Field" & $FieldNumber ) Is there a way around this without using the "Set Field" in a loop.
comment Posted September 27, 2010 Posted September 27, 2010 The target field for Replace Field Contents[] cannot be specified dynamically. Using Set Field [] in a loop will not change the basic situation - only Set Field by Name[] will accept a variable as the target field. The simplest solution, IMHO, is to place five Replace Field Contents[] steps in a If/ElseIf/ElseIf… block. Alternatively, you could use Go to Object[] or looped Go to Field[] to select the target field, then perform Replace Field Contents[] without specifying the target field. However, this requires all five fields to be on the layout. Note also that having five "similar" fields is usually a sign of inadequate data structure.
Recommended Posts
This topic is 5172 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 accountSign in
Already have an account? Sign in here.
Sign In Now