I need to print out over the serial. => t0.txt="9999"
In C I can use print("t0.txt=\"9999\""
Forth is not accepting the \, how should I program this in forth?
Cheers,
Jan
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FF is a bit simple to keep the size down. with [CHAR] you can get the ASCII code for any character and print it with EMIT. [CHAR] is for compilation mode, while CHAR works in interpretation mode.
:quote.(n-- ) [char] " emit . [char] " emit ;
But the DOT word prints an extra space after the number which may not be what you wanted
I need to print out over the serial. => t0.txt="9999"
In C I can use print("t0.txt=\"9999\""
Forth is not accepting the \, how should I program this in forth?
Cheers,
Jan
FF is a bit simple to keep the size down. with [CHAR] you can get the ASCII code for any character and print it with EMIT.
[CHAR] is for compilation mode, while CHAR works in interpretation mode.
But the DOT word prints an extra space after the number which may not be what you wanted
Here is an example quoting a string
Last edit: Mikael Nordman 2023-04-21