Hello,
I want to create a word and store a generated id and a string in the
datafield.
I have the following words:
variable ma#
68 ma# ! \ just to find the value in the memoy
: ma: ( -- )
1 ma# +! \ increment ma# - is there a better way?
create ma# @ , \ reserve space and store the value of ma#
parse-name 2, \ get next word and store addr and length
does> ( -- u) @ ;
With the following definition:
ma: robert rs
I expect to see 69 when calling the word robert:
robert . 69 ok
When using the address of the word robert I have to get the address
of the body:
' robert >body ? 69 ok
Now I want to see the string "rs":
' robert >body 1 cells + 2@ type c ok
but this does not work.
What am I doing wrong?
--
Robert Sander