AddOption - method of object PmiWCombo

Add text to list (hidden values and visible text) When the Sort configurator isn't set, then the text is added at the end of the list, otherwise the text is inserted to the corresponding position.
AddOption(sOption As String)
oCombo.AddOption sOption
sOption(String) added text in the form val=text, where val represents the hidden value of the option (identifier), text represents the displayed text of the option itself and that can be in the form of Macro expression $.text.
The method can also be called in the graphic item events for Web panels. The Macro expression $.text in parameter is not functional for Web (the localised texts are not directly accessible on the Web). The solution is using #pragma variable x = Macro("macro expression") in the script.
The example updates the list. At first it clears the list, then adds three rows and then selects (by index) the third row. Consequentially it finds the selected text, hidden value and index. Then the text that is on the 2nd row and finally the number of rows in the list is detected.
oCombo.AddOption "val1=First"
oCombo.AddOption "val2=Second"
oCombo.AddOption "val3=Third"
oCombo.SelectedIndex = 2
sSelText = oCombo.SelectedText
sSelValue = oCombo.SelectedValue
nSelIndex = oCombo.SelectedIndex
sText = oCombo.Options(1)
nCount = oCombo.OptionsCount
PROMOTIC 8.3.20 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice