September 14, 200520 yr 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
September 14, 200520 yr In your example, you are always setting the same field. Only the contents change - and that can definitely be a calculation.
September 15, 200520 yr 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 ) )
Create an account or sign in to comment