The Structs BASIC library provides routines for handling structures.
It was written using some long-standing, but unimplemented, ideas for
Basalt, because structures have been high on the list of wants for
BASIC. It is not going to be fast, but it may be of interest
Prototypes of structures are defined and new structures are created from
them, or they can be applied to existing blocks of memory, such as
window info.
Prototype variables catered for are:
integer% a 4-word integer
string$ a 5-byte SIB for a string
string$[n] a string in a buffer of length n+1, read as string$
string! an indirected external string, read as string$
byte? a 1-byte integer
float| a 5-byte floating point number
substr{proto} a substructure in the main structure
substr{} an indirected external substructure
array#(n) an array with n+1 elements; types: # = % $ ? | !
array(n){proto} an array of n+1 substructures
array#() an indirected external array; types: # = % $ |
Substructures can be nested and are referenced by name only:
Subproto=(FNcDEF{byte?,buffer$[15],external!})
Prototype=(FNcDEF{word%,string$,float|,substr(5){Subproto}})
struct=FNcNEW(Prototype)
PROCc{struct,substr(1),buffer$="Hello World"}
PRINT (FNc{struct,substr(1),buffer$})
Structs can be downloaded from:
http://www.kappa.me.uk/structs.htm
_______________________________________________________________
a.m.c...@argonet.co.uk, Moderator of comp.sys.acorn.announce.
Submissions to
cs...@owlart.net
Related mail to
csaa-r...@owlart.net