nextvalue
ITEM
,
VALUES
,
SEPARATOR

The nextvalue statement advances a variable or field to the next value in a list.


Parameters

This statement has three parameters:

item – the variable or field to be modified.

values – the list of values to cycle through. If this parameter is omitted the variable or field will be assumed to be a boolean true/false choice.

separator – the separator used for the value list. If this parameter is omitted the statement will automatically determine the separator (see below).


Description

This statement will cycle the value of an item through a list of values. In this example, the color will advance to the next color each time the nextvalue statement is invoked, cycling back to the first color when the end of the list is reached.

let colors = "red,blue,green,yellow,pink"
let color = "green"
nextvalue color,colors,","
message color ☞ yellow
nextvalue color,colors,","
message color ☞ pink
nextvalue color,colors,","
message color ☞ red

If the separator parameter is omitted the statement will attempt to automatically determine the separator by looking at the list. It will check for the presence of carriage returns, line feeds, tabs, semicolons, slashes, commas or spaces, and if found, use that character as the separator. In this example Panorama automatically determines that the separator character is a comma.

let colors = "red,blue,green,yellow,pink"
let color = "green"
nextvalue color,colors
message color ☞ yellow
nextvalue color,colors
message color ☞ pink
nextvalue color,colors
message color ☞ red

If only a single parameter is passed, the value list defaults to the boolean values true() and false(), so the value will toggle on and off with each invocation. If the variable/field does not currently contain either true or false it is set to true as default.

let arrived = false()
nextvalue arrived
message boolstr(nextvalue) ☞ TRUE
nextvalue arrived
message boolstr(nextvalue) ☞ FALSE

If the variable/field is empty or contains a value not in the accepted list of values it will be set to the first value in the list as default.

let colors = "red,blue,green,yellow,pink"
let color = "brown"
nextvalue color,colors,","
message color ☞ red

See Also


History

VersionStatusNotes
10.2NewNew in this version.