home *** CD-ROM | disk | FTP | other *** search
- \ string-constants
-
- \ ----------
- \ String constant from Ron Doerfler's Expedition source
- needs file
- needs core-ext
-
- \ Place is copied from toolkit so toolkit doesn't have to be included
- \ place a1 n1 as a counted string at a2
- : place1 ( a1 n1 a2 -- )
- 2dup 2>r char+ swap move 2r> c! ;
-
- : null>end ( u c-addr -- )
- \ appends null -- must be allocated
- + char+ 0 swap c! ;
-
- : sconstant ( buf-addr u <name> -- )
- \ limited to 255 characters. S" input
- \ buffer in file memo has limit of 80
- create dup here 2>r \ size & start
- here over 2 chars + allot \ allot RAM
- place1 \ buffer --> counted string
- 2r> null>end \ add null
- does> dup c@ swap char+ swap
- ( c-addr u ) ;
-
- : s>zabs ( c-addr u -- &z-addr )
- \ Use only with string obtained
- \ from sconstant or svariable
- drop >abs ;
-
- : s>abs ( c-addr len -- a-addr. len )
- >r >abs r> ;
-
- \ -- end of sconstant
-