Variable as array?

Clovertech Forums Cloverleaf Variable as array?

  • Creator
    Topic
  • #118097
    Rich
    Participant

      Gents,

      As always, thank you so much for your continued support!

      If I copy PID.18 (Account Number) into a variable (say @AN), Could I treat it like an array for the sake of evaluation?  Like: If @AN[0] = 5

      Would that work?

    Viewing 1 reply thread
    • Author
      Replies
      • #118098
        Rob Abbott
        Keymaster

          The @variables in Xlate are simple strings, so no you can’t address them this way.

          Rob Abbott
          Cloverleaf Emeritus

          • #118099
            Rich
            Participant

              Thanks Rob!  Is there a way to use a numeric variable?  My problem is that Cloverleaf 6.0 won’t let me do a substring search of PID.18.  I’m guessing because it’s numeric.

            • #118100
              Rich
              Participant

                Another question might be, can I pull the first digit directly out of 0(0).PID(0).#18(0)  by adding (0)(0) ?

            • #118101
              Jim Kosloskey
              Participant

                If you are on CL 6.0 or later, look at the STRING Action Substr Function.  That would allow you to pull out the characters you want by position and place them in a Temp Variable.

                You can then use an IF Action against the temp variable.

                If you are on an earlier release, you will need to use Tcl. I have a proc that does that. If you want that email me but if you can use the STRING Action, I would advise that.

                email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            Viewing 1 reply thread
            • You must be logged in to reply to this topic.