GetCurrentSelections() returns the current selections in the document.
If options are used you will need to specify record_sep. To specify a new line set record_sep to chr(13)&chr(10).
If all but two, or all but one, values, are selected, the format 'NOT x,y' or 'NOT y' will be used respectively. If you select all values and the count of all values is greater than max_values, the text ALL will be returned.
GetCurrentSelections ([record_sep [,tag_sep [,value_sep [,max_values]]]])
Return data type: string
- record_sep: Separator to be put between field records. The default is <CR><LF> meaning a new line.
- tag_sep: Separator to be put between the field name tag and the field values. The default is ': '.
- value_sep: The separator to be put between field values. The default is ', '.
- max_values: The maximum number of field values to be individually listed. When a larger number of values is selected, the format 'x of y values' will be used instead. The default is 6.
The following examples use two fields loaded to different list boxes, one for First name name and one for Initials.
Example 1: John is selected in First name
returns 'First name: John'.
Example 2: John and Peter are selected in First name.
returns 'First name: John, Peter'.
Example 3: John is selected in First name and JA is selected in Initials.
returns 'First name: John; Peter and Initials: JA'.
Example 4: John is selected in First name and JA is selected in Initials.
GetCurrentSelections ( chr(13)&chr(10) , ' = ' )
returns 'First name = John and Initials = JA'.
Example 5: all names except Sue selected in First name and no selections in Initials.
returns 'First name=NOT Sue'.
Data used in example:
LOAD * inline [
"First name"|"Last name"|Initials|"Has cellphone"
Peter|Franc|PF|Yes ] (delimiter is '|');