Trooper Posted April 17, 2008 Share Posted April 17, 2008 I am currently typing in a basic listing from a magazine and in the comments it says "In line 600 the curly bracket is a clear screen command".....now I can't find a way to enter such a command, could anyone help me out? Quote Link to comment Share on other sites More sharing options...
Urchlay Posted April 17, 2008 Share Posted April 17, 2008 Press Escape, then shift and the Clear key (the shifted version of the less-than symbol). It'll print kind of an inverse video bent arrow that points up and to the left. If you don't press Escape first, it'll clear the screen when you type it. You could also print CHR$(125) in a BASIC program. Quote Link to comment Share on other sites More sharing options...
Trooper Posted April 18, 2008 Author Share Posted April 18, 2008 Thanks a lot!! Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 18, 2008 Share Posted April 18, 2008 Should be ? "<esc><clr>"; actually (semi-colon). A handy trick: normally BASIC doesn't let you do GET/PUT etc to device 0 (which "E:" normally uses). To get around that, use #16. So, a printer-friendly CLS command would be PUT #16,125 Quote Link to comment Share on other sites More sharing options...
atarixle Posted April 19, 2008 Share Posted April 19, 2008 you mean #6 (ATARI has only 8 Channels #0 ... #7) Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 19, 2008 Share Posted April 19, 2008 No, #16 BASIC disallows "0" on the GET/PUT statements. Not sure why, since it allows INPUT #0 and PRINT #0. But, it performs an AND on the parameter you supply, so 16 gets converted to 0 and it lets it through. #6 isn't always open. Try ?#6 on a fresh BASIC screen, you get an error. But, type GR.0 then ?#6 and the device will work. Quote Link to comment Share on other sites More sharing options...
+Larry Posted April 19, 2008 Share Posted April 19, 2008 Should be ? "<esc><clr>"; actually (semi-colon). A handy trick: normally BASIC doesn't let you do GET/PUT etc to device 0 (which "E:" normally uses). To get around that, use #16. So, a printer-friendly CLS command would be PUT #16,125 Neat little trick! There is another little trick that was once in INSIGHT: Atari that is related. To get rid of the "?" prompt that results from an INPUT, use INPUT #16, XYZ. Evidently works the same way, and although I've remembered and used this many times, I never understood its roots. -Larry Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 19, 2008 Share Posted April 19, 2008 (edited) Forgot to mention that one. Discovered it some time ago too. Likely that BASIC just outputs the ? if the device # is zero. You'd not want it to happen, for example if you had a concurrent I/O file open to disk, so they would have put that simple check in place. Edited April 19, 2008 by Rybags Quote Link to comment Share on other sites More sharing options...
atarixle Posted April 19, 2008 Share Posted April 19, 2008 Wow, not bad, that trick ... The ATARI has 8 Channels, so it cuts the first unnessesary bit (16 - 2^4 = 0) ... but BASIC hides the '?' ... I'm writing BASIC-programs for 16 years now ... but that trick is new for me :-) thanks! Quote Link to comment Share on other sites More sharing options...
Urchlay Posted April 19, 2008 Share Posted April 19, 2008 One minor gotcha regarding I/O with channel #16: if you plan to compile your program with the Turbo BASIC XL compiler, don't use this trick. It'll work in interpreted Turbo BASIC, and the compiler won't complain about it... but the runtime will stop the compiled program with an error message (in German, can't remember what it says) when it gets to the INPUT #16. Quote Link to comment Share on other sites More sharing options...
+Larry Posted April 20, 2008 Share Posted April 20, 2008 One minor gotcha regarding I/O with channel #16: if you plan to compile your program with the Turbo BASIC XL compiler, don't use this trick. It'll work in interpreted Turbo BASIC, and the compiler won't complain about it... but the runtime will stop the compiled program with an error message (in German, can't remember what it says) when it gets to the INPUT #16. Yes, and ditto ABC, although I can't remember whether it gives an error message or not. We are so fortunate to have such a nice selection of languages for our 8-bits! -Larry Quote Link to comment Share on other sites More sharing options...
Rybags Posted April 20, 2008 Share Posted April 20, 2008 A possible workaround might be to use GET #A,B Have variable A set to 0 for compiles, 16 for interpreter versions. No idea if that'll work though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.