Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

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

Posted

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 ) )

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 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.