Yep. Just put that on the end of KEY and it will run automatically.
Automatically running KEYs
12Me21Created:
Interesting to note that KEY 5,"CLS"+CHR$(13)+"PRINT 5"+CHR$(13) will just clear the screen when you tap key 5. On the other hand, KEY 5,"CLS"+CHR$(10)+"PRINT 5"+CHR$(13) will clear the screen, and put 5 at the top of the screen.
Interesting to note that KEY 5,"CLS"+CHR$(13)+"PRINT 5"+CHR$(13) will just clear the screen when you tap key 5. On the other hand, KEY 5,"CLS"+CHR$(10)+"PRINT 5"+CHR$(13) will clear the screen, and put 5 at the top of the screen.Interesting. You could also just use this ":" to separate commands.
You could also just use this ":" to separate commands.Not always. For example, CLEAR:CLS will not clear the screen. EDIT: Also, LOAD "FILE":RUN gives a Syntax error, which was my interest in using the keys.
I believe : was required to separate back in PTC.You could also just use this ":" to separate commands.Not always. For example, CLEAR:CLS will not clear the screen.
I believe : was required to separate back in PTC.No, it was not required.
You can use it to separate commands in PTC and SmileBASIC. And what do you mean it was not required?I believe : was required to separate back in PTC.No, it was not required.
Not always. For example, CLEAR:CLS will not clear the screen. EDIT: Also, LOAD "FILE":RUN gives a Syntax error, which was my interest in using the keys.Well that's weird.
In some cases, where it was clear that there was the beginning of a new command and not a continuation of the previous one, the command separator was not necessary: e.g. A=5B=2, there is no way B is part of the value that is meant to be assigned to the variable A, so it was taken to be the beginning of a new command.You can use it to separate commands in PTC and SmileBASIC. And what do you mean it was not required?I believe : was required to separate back in PTC.No, it was not required.
Garrr... and KEY 5,"LOAD"+CHR$(34)+"FILE"+CHR$(34)+CHR$(10)+"RUN"+CHR$(13) doesn't work. WHYYYY...Not always. For example, CLEAR:CLS will not clear the screen. EDIT: Also, LOAD "FILE":RUN gives a Syntax error, which was my interest in using the keys.Well that's weird.
Garrr... and KEY 5,"LOAD"+CHR$(34)+"FILE"+CHR$(34)+CHR$(10)+"RUN"+CHR$(13) doesn't work. WHYYYY...Can't we just use EXEC? EG:KEY 5, "EXEC "+CHR$(34)+"FILE"+CHR$(34)+CHR$(13)
Can't use from direct modeerror. Why? ... It's SmileBoom. Who could know why.
CHR$(13) is the linefeed character, while CHR$(10) is the carriage return character, correct? So when it encounters a linefeed, it probably just tosses out all the text that comes after it. CHR$(13) tells the command line "alright boys, take the input buffer and parse it." My assumption is that a function key writes its contents to input one character at a time, instead of all at once. Sticking a CHR$(10) inbetween lets you send multiple lines of code at once.