Original Author Paul Laughton, 2011
Page 49
De Re BASIC!
Bundle.put <pointer_nexp>, <key_sexp>, <value_nexp>|<value_sexp>
The value expression will be placed into the specified bundle using the specified key. If the bundle does
not exist, a new one may be created.
The type of the value will be determined by the type of the value expression.
Example:
BUNDLE.PUT bptr, "first_name", "Frank"
BUNDLE.PUT bptr,"age", 44
Bundle.get <pointer_nexp>, <key_sexp>, <nvar>|<svar>
Places the value specified by the key string expression into the specified numeric or string variable. The
type (string or numeric) of the destination variable must match the type stored with the key. If the
bundle does not exist or does not contain the requested key, the command generates a run-time error.
Example:
BUNDLE.GET bptr,"first_name", first_name$
BUNDLE.GET bptr,"age", age
Bundle.keys <bundle_ptr_nexp>, <list_ptr_nexp>
Returns a list of the keys currently in the specified bundle.
The bundle pointer parameter <bundle_ptr_nexp> specifies the bundle from which to get the keys. If
the bundle does not exist, a new one may be created.
The list pointer parameter <list_ptr_next> specifies the list into which to write the keys. The previous
contents of the list are discarded. If the parameter does not specify a valid string list to reuse, and the
parameter is a string variable, a new list is created and a pointer to the list is written to the variable.
The key names in the returned list may be extracted using the various list commands.
Example:
BUNDLE.KEYS bptr, list
LIST.SIZE list, size
FOR i = 1 TO size
LIST.GET list, i, key$
BUNDLE.TYPE bptr, key$, type$
IF type$ = "S"
BUNDLE.GET bptr, key$, value$
PRINT key$, value$
ELSE
BUNDLE.GET bptr, key$, value
PRINT key$, value
ENDIF
NEXT i