Author Topic: Liquid UI - linerecordsplit Command  (Read 3588 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
Liquid UI - linerecordsplit Command
« on: November 09, 2017, 03:45:28 AM »
Process:
The linerecordsplit command is used to break up a long string into its component parts based on the parameters.

Syntax:
var elementArr = linerecordsplit(z_string, [{"label":"Name1", "length":10}, {"label":"Name2", "length":20}]);
label: the label is always paired with a length. Together, they identify the split parts of the string.
length: length specifies the length to split from the string and it is always paired with label.

You can either use a single entry format or an array.
Below are the Possible syntaxes
Single entry:
{"label":"Name1","length":20}
Array:
[{"label":"NAME1", "length":20}, {"label":"NAME2", "length":10}]

LiquidUI Script:
/////////////////////////// SAPLSMTR_NAVIGATION.E0100.sjs //////////////////////////

var z_string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var elementArr = linerecordsplit(z_string, [{"label":"NUMBERS", "length":10}, {"label":"ALPHABETS", "length":20}]);

println("label NUMBERS is "+elementArr.NUMBERS);
println("label ALPHABETS is "+elementArr.ALPHABETS);

You can see output on Cornelius window.
elementArr.NUMBERS as "0123456789"
elementArr.ALPHABET as "ABCDEFGHIJKLMNOPQRST"

Note: The split will always start from the frist character of the string.
You cannot extract a portion of the original string from the middle.


See attachment for more screenshots