String terminator
Vladimir Shevchenko (2094) 88 posts |
BASIC line: *Echo processes the PRINT 55 as a part of the string. Why? |
||
GavinWraith (26) 1563 posts |
On page 1 of the BBC BASIC GUIDE you will find:
The argument of an operating system command extends to the end of the line. So the Echo command has all of |G<13><10><0>:PRINT 55 as its argument. Try using OSCLI instead, such as
What string? There is no BASIC string anywhere on line 20, only the tail of a commandline. Once the BASIC interpreter sees the * at the beginning of the line it hands over the rest of the line to the OSCLI (Operating System Command Line Interface). It only gets control back again when the OSCLI has finished doing its thing. The BASIC command OSCLI, by contrast, evaluates its argument as a BASIC expression and then hands the result to the OSCLI. |
||
Steve Fryatt (216) 2105 posts |
BASIC line: A * passes the entire rest of the line to the OS CLI; it does not respect any BASIC syntax, including the : line separator. That means that your code above will present the CLI with *Echo |G<13><10><0> : PRINT 55 which it will then process by echoing “|G<13><10><0> : PRINT 55” to the screen via GSTrans. If you want to use *Echo, you’d be better off with OSCLI as Gavin states. However, I’m not clear why you’re using *Echo at all. Wouldn’t PRINT CHR$(7);CHR$(13);CHR$(10);CHR$(0);55 be a better way to achieve the same result from within BASIC? |
||
Vladimir Shevchenko (2094) 88 posts |
Thank you. Edit: I thought that the ‘Echo’ has to stumble about the <13><10><0> and cut off the end (PRINT 55). Now I understand that these are for GSTrans simply printable symbols, stuff for processing, data, but not the string terminator. The real terminator (invisible) was inserted after ‘PRINT 55’. |