Simple Data Structures don't need conversions and don't have a fixed structure either. The items in the record are simply separated by a string. I usually use ";;" This makes the definition much simpler as we just concatenate the items (with separator) or use the PARSE statement to extract them
Example:
structure="Name IDNo Telephone Address"
strdef1=declare('DEFINE',structure,";;")
SAY "Defined, PARSE string:" strdef1
NAME="John Smith"
idno="2178"
telephone=442518234
ADDRESS="Leicester Court Road 2356"
inrec=declare('PUT',strdef1)
SAY "Constructed Record: "inrec
DROP NAME idno telephone ADDRESS
a=declare('GET',strdef1,inrec)
SAY 'Name : 'NAME
SAY 'IDNo : 'idno
SAY 'Telephone: 'telephone
SAY 'Address : 'ADDRESS
EXIT
the DECLARE procedure is attached! |