EXPLODE Examples


Example 1:

 

A

INIT

"ABC;DEF;RST"

 

B

INIT

"123,456,789"

 

FX

FORM

"12345.02"

 

.

 

 

 

ARR

DIM

20(5)

 

X1

DIM

10

 

X2

DIM

10

 

X3

DIM

10

 

F1

FORM

5

 

F2

FORM

5

 

F3

FORM

5

 

.

 

 

 

V1

VARLIST

X1,X2,X3

 

V2

VARLIST

F1,F2,F3

 

.

 

 

 

ET

EDITTEXT

 

 

ST

STATTEXT

 

 

.

 

 

 

  

EXPLODE

A,";",ARR

;Explode into an array

  

EXPLODE

A,";",X1,X2,X3

;Explode into string variables

  

EXPLODE

A,";",V1

;Explode into a string varlist

  

EXPLODE

B,",",F1,F2,F3

;Explode into numeric variables

  

EXPLODE

B,",",V2

;Explode into a numeric varlist

  

EXPLODE

FX,".",F1,F2

;Explode into numeric variables

.

 

 

 

. ET and ST must be CREATEd objects.

.

 

 

 

  

EXPLODE

A,";",ET,ST

;Explode into objects

 

This example shows the various uses of the EXPLODE statement.

 

Example 2:

 

SRC

INIT

"A;B"

A

DIM

5

B

DIM

5

C

DIM

5

NVAR

FORM

3

.

 

 

  

EXPLODE

SRC,";" GIVING NVAR,A,B,C

  

EXPLODE

SRC,";" GIVING NVAR USING A,B,C

  

EXPLODE

SRC,";",A,B,C

  

EXPLODE

SRC,";" USING A,B,C

 

More examples of EXPLODE including the GIVING clause.

 



PL/B Language Reference EXP Example EXTEND Examples