From: Matthias T. <mt...@we...> - 2013-11-14 20:00:57
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Craig, > I'm trying to create a label defining word which I would like to > work as follows: > > xPos yPos s" this is the labels text" label: labelName > > I tried this code: > > \ Define a label that places itself : label: ( x y addr > count --- ) create , , , , does> dup over over 3 + @i swap 2 + @i > moveCursor 1+ @i @i ; > > which at run time I want to return the addr and count of the labels > text in flash. > > The problem is, I think, that s" doesn't compile to flash outside > of a definition. Indeed. something like : label: create sliteral , , does> ... ; may work (haven't tested it) The sliteral takes the addr/len pair that is left from the s" in interpreter mode and compiles it into the flash. The does> part gets the flash address instead of the RAM addresses. Note that when using the label: word, the s" ... " and the "label:" must be on the same line, line breaks wont work, since the s" leaves addresses from the terminal input buffer and does not copy the string elsewhere. Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlKFK+gACgkQ9bEHdGEMFjPsNgCg+cI99xTZB+8lE0xPwceVznYn V4MAn2QS/PYbemMkz6jjOgGLd0TL/VBs =LVxu -----END PGP SIGNATURE----- |