Slobey Posted September 14, 2005 Posted September 14, 2005 Hi gang, I have a script that uses a variable to determine which fields contents are to be set into another field. For now I have the following script: If [right ($$v_Diagram;2) = "01"] Set Field [iSP::Diagram_orig; ISP::Photo 01] Else If [right ($$v_Diagram;2) = "02"] Set Field [iSP::Diagram_orig; ISP::Photo 02] Else If [right ($$v_Diagram;2) = "03"] Set Field [iSP::Diagram_orig; ISP::Photo 03] I have 20 different possiblilities. I would like to have a single script step that would set the field using a calculation. I know there is no "field by calculation" step, is there another way to do this? Thanks
comment Posted September 14, 2005 Posted September 14, 2005 In your example, you are always setting the same field. Only the contents change - and that can definitely be a calculation.
Slobey Posted September 15, 2005 Author Posted September 15, 2005 Yes but the contents are another field.
comment Posted September 15, 2005 Posted September 15, 2005 That doesn't matter. This single script step: Set Field [iSP::Diagram_orig; Let ( test = Right ( $$v_Diagram ; 2 ) ; Case ( test = "01" ; ISP::Photo 01 ; test = "02" ; ISP::Photo 02 ; test = "03" ; ISP::Photo 03 ) ) ] will do exactly what your example above does. The calc can probably be shortened further using Choose() or Evaluate(), e.g.: Evaluate ( "ISP::Photo " & Right ( $$v_Diagram ; 2 ) )
Recommended Posts
This topic is 7011 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