IMPLODE


8.7B

 

The IMPLODE instruction assembles data from variables or objects into a single delimited destination variable.

 

(1)

[label]

IMPLODE

{dest}{sep}{delim}{sep}{source}

(2)

[label]

IMPLODE

{dest}{sep}{delim} GIVING {result}{sep}{source}

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable or FORM variable that is assembled.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

delim

Required. A previously defined Character String Variable, Literal, decimal, octal, or hexadecimal value that defines a single delimiter value that separate individual fields in the {source} variable.

source

Required. A previously defined Character String Variable, Numeric Variable, a list of string and/or numeric variables, a VARLIST of string and/or numeric variables, or objects from which data is gathered.

result

Required. A previously defined Numeric Variable that receives the number of items that have been stored into the {dest} variable from the {source} list of variables.

Flags Affected: EOS

Note the following:

  1. If the {delim} variable is a Null String, the instruction does not store a delimiter character in the {dest} string.

  2. When {delim} is a Character String Variable or a Literal, the form pointer specifies the delimiter character that separate individual fields in the {dest} variable.

  3. When {delim} is a decimal, octal, or hex value, the numeric value identifies the delimiter character that separates individual fields in the {source} variable. The value must be between zero to 255. A compiler error will occur if the value is not in this range.

  4. If the {dest} variable is too small to receive all of {source} list data and delimiter characters, the EOS flag is set.

  5. The IMPLODE instruction will store back to back delimiter characters in the {dest} variable when the corresponding {source} list variable does not contain any data.

  6. If a {source} list variable is a GUI object, the GUI object must have been previously created. Otherwise, an O105 error will occur.

  7. The {dest} and the first {source} variable may be the same.

  8. The IMPLODE instruction will retrieve data from the GUI objects just as a GETITEM instruction. The data is retrieved as follows:

  9.  

    Object

    The data is retrieved the same as when GETITEM has a ...

    EDITTEXT

    EDITDATETIME

    RICHEDITTEXT

    LABELTEXT

    STATTEXT

    character string destination and the {item} number is zero.

    BUTTON

    EDITNUMBER

    CHECKBOX

    RADIO

    numeric variable as the destination and the {item} number is zero.

    COMBOBOX

    negative one (-1) item number.

     

  10. Both the PLBSERVE and PLBCLIENT must be a version 9.3A or later to allow use of a COMBOBOX.

 

 

See Also: Example Code, EXPLODE, PACK, PACKKEY, Character String Instructions

 



PL/B Language Reference HASH LCMOVE