stt - Stringtable module

Module Description

The stt module implements a stringtable with counted strings. The code is inspired by Wil Badens stringtable.

Module Words

Stringtable syntax words

begin-stringtable ( "<spaces>name" -- stringtable-sys ; n -- c-addr u )
Start a named stringtable definition; return the nth string

place ( c-addr1 u1 c-addr2 -- )
Place the string c-addr1 u1 at address c-addr2 as counted string

end-stringtable ( stringtable-sys -- )
End the stringtable definition

Examples

include ffl/stt.fs


\ Example : the month names in a stringtable


\ Create the stringtable in the dictionary

begin-stringtable months
," January"
," February"
," March"
," April"
," May"
," June"
," July"
," August"
," September"
," October"
," November"
," December"
end-stringtable

\ Fetch strings from the stringtable

0  months type cr       \ January
11 months type cr       \ December



  

    

generated 10-Apr-2008 by ofcfrth-0.5.0