I’m having action script that reads output from file and trying to use “tuple” statement to return individual values
there are some instances where output does not always contain all the subitems
i want to know how I can check this and if file is not having the right items replace this with N/A or something similar.
parameter “_IPInfo” = “155.119.213.66;155.119.0.0;255.255.0.0;EU - BELGIUM1 - BELGIUM2 - 0257”
parameter "_Value0" = "{tuple string item 0 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by ";" of (parameter "_IPInfo")))))}"
parameter "_Value1" = "{tuple string item 1 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by ";" of (parameter "_IPInfo")))))}"
parameter "_Value2" = "{tuple string item 2 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by ";" of (parameter "_IPInfo")))))}"
parameter "_Value3" = "{tuple string item 3 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by ";" of (parameter "_IPInfo")))))}"
parameter "_Value4" = "{tuple string item 4 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by ";" of (parameter "_IPInfo")))))}"
below is the output and it failed on last statement as that item did not exist
Command succeeded parameter “_IPInfo” = "155.119.213.66;155.119.0.0;255.255.0.0;EU - BELGIUM1 - BELGIUM2 - 0257"
Command succeeded parameter “_Value0” = "EU"
Command succeeded parameter “_Value1” = "BELGIUM1"
Command succeeded parameter “_Value2” = "BELGIUM2"
Command succeeded parameter “_Value3” = "0257"
Command failed (Relevance substitution failed) parameter “_Value4” = "{tuple string item 4 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation ", " of (substrings separated by “;” of (parameter “_IPInfo”)))))}"
Command failed (Relevance clauses must be surrounded by { and } guards.) parameter “_Value4” = "{tuple string item 4 of (concatenation ", " of (substrings separated by " - " of tuple string item 3 of (concatenation “, " of (substrings separated by “;” of (parameter “_IPInfo”)))))}”
Thx