"String + extensions"string
The basic words for handling string buffers. There are
much more buffer words used in most Forth implementations around
but they can usually implemented as colon-word quite effectivly
on the basis of the STRING wordset.
[ANS]
check the given buffer if it contains whitespace at its end.
If so, shorten str-len to meet the last non-whitespace
character in the buffer.
| string ordinary primitive
shorten the buffer from the beginning by n characters, i.e.
str-ptr += n ;
str-len -= n;
| string ordinary primitive
FILL a given buffer with BL blanks
| string ordinary primitive
memcpy an area from->to for len bytes, starting at
the lower addresses, see CMOVE>
| string ordinary primitive
memcpy an area from->to for len bytes, starting
with the higher addresses, see CMOVE
| string ordinary primitive
compare both str-buffers, return 0 if they are equal,
-1 if lower or shorter, and 1 if greater or longer
| string ordinary primitive
search the str-buffer1 for the text of str-buffer2,
if it is contained return TRUE and return buffer-values that
point to the contained string, otherwise return FALSE and
leave the original str-buffer1.
| string ordinary primitive
compile-time: ( CS: str-ptr str-len -- )
this word does almost the same as LITERAL - it takes
an S" string as specified in the CS-STACK at compile
time and compiles into the current definition where it is
returned as if there were a direct string-literal. This
can be used to compute a string-literal at compile-time
and hardwire it.
example:
: ORIGINAL-HOME [ $HOME COUNT ] SLITERAL ; ( -- str-ptr str-len )
| string compiling primitive
ENVIRONMENT
ENVIRONMENT STRING-EXT no special info, see general notes string ordinary constant
|