xlateStrSplit – Need example how should work

Clovertech Forums Cloverleaf xlateStrSplit – Need example how should work

  • Creator
    Topic
  • #119553
    Rob Brown
    Participant

      New to Cloverleaf engine and trying to learn the string actions and how they work. I have checked user guide and not seeing any examples for many of the commonly used string actions.

      I want to split a simple date with hyphens: 2022-02-05

      I wish to use the String action xlateStrSplit but receiving error.

      I am using this syntax in the String Action Content window:

      xlateStrSplit –

      and on the destination I have three variables to dump the values into:

      @year

      @month

      @day

      Getting error:

      Error Info ‘Tcl callout error
      xlateStrSplit -:

      errorCode: NONE

      errorInfo:
      error storing into “@month”:
      while executing
      “xpmstore $xlateId $outAdd $xlateConstType [lindex $_splittedResultList $_listIndex] -type $outType”
      (procedure “xlateStrSplit” line 20)
      invoked from within
      “xlateStrSplit -”
      <End of errorInfo>
      ‘ error in ‘XLATE UIH_LS162_DFT.xlt’ under ‘_HCI_static_route_’ to ‘IB_UIH_TEST_DFT’;

       

      Screenshot attached of my String action.

      What is correct syntax to use the xlateStrSplit function using hyphen as delimiter.

      Attachments:
      You must be logged in to view attached files.
    Viewing 1 reply thread
    • Author
      Replies
      • #119555
        Jim Kosloskey
        Participant

          I think one or more of the temp variables you have specified as the target of the split is a system temp variable. Those are read only and will throw an error if you try to write to them.

          Try making them unique (like @my_month) and see if that does not correct the situation.

          I recommend my clients create an Xlate with an example of all of the STRING ACTION Functions so that they have a quick reference to usage.

          I also have a Powerpoint documenting various STRING Actions which I provide to my clients.

          If you would like the Powerpoint, email me and I will send it to you. It is missing a couple of the Functions but maybe you can expand the Powerpoint.

          Welcome to Cloverleaf and clovertech.

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

        • #119556
          Rob Brown
          Participant

            That was it–problem resolved. You are fantastic and thank you very much. I will look for a list of those internal temp variables used by Cloverleaf as that will come in handy!

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