Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #4997
| Newsgroups | comp.sys.apple2.programmer |
|---|---|
| Date | 2019-02-03 10:19 -0800 |
| References | <f52655a8-0fd6-4aee-b345-8631bb8b3b38@googlegroups.com> <2b9c4542-55b8-4f71-97d1-e0b5ad57b5b4@googlegroups.com> <yubpnsaavnc.fsf@gmail.com> <q35op4$ouf$1@dont-email.me> |
| Message-ID | <a633aa85-3b85-43df-bb6b-e34e21daebbe@googlegroups.com> (permalink) |
| Subject | Re: Call Address to Print BASIC Error Message |
| From | gids.rs@sasktel.net |
On Saturday, February 2, 2019 at 9:56:21 PM UTC-6, Jeff Blakeney wrote: > On 2019-02-02 1:32 p.m., awanderin wrote: > > Here's an all-Applesoft way to do it. Substitute your choice of error > > on line 20... > > > > 10 ONERR GOTO 1000 > > 20 PRINT 1 / 0 : REM Generate error > > 30 END > > 1000 BE = 53856 > > 1010 EA = BE + PEEK (222) > > 1015 GOSUB 1050 > > 1020 EA = BE + 240: GOSUB 1050 > > 1030 PRINT " IN LINE " PEEK (218) + 256 * PEEK (219) > > 1040 END > > 1050 C = PEEK (EA): IF C > 0 AND C < 128 THEN PRINT CHR$ (C);:EA = EA + 1: GOTO 1050 > > 1055 IF C > = 128 THEN PRINT CHR$ (C); > > 1060 RETURN > > Just curious why you are checking for C being from 1 to 127 and then > later checking to see if it is greater than 127. In both cases you are > printing CHR$(C). > > C will always be between 0 and 255 so the first check could be reduced > to just "IF C < 128 THEN PRINT CHR$(C);". > > I'm assuming you did this to avoid printing the high ASCII last > character so line 1055 should probably be "IF C > 127 THEN PRINT > CHR$(C-128);". However, as we know that the condition that exits the > loop is that C is greater than 127 all you really need on line 1055 is > "PRINT CHR$(C-128);". No need to duplicate the CHR$(C)or have multiple lines. 1050 C= PEEK(EA): PRINT CHR$(C): EA = EA + 1: ON C < 128 GOTO 1050: RETURN
Back to comp.sys.apple2.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Call Address to Print BASIC Error Message Bill Chatfield <billchatfield1@gmail.com> - 2019-01-30 15:16 -0800
Re: Call Address to Print BASIC Error Message James Davis <JPD.Enterprises@outlook.com> - 2019-01-30 18:21 -0800
Re: Call Address to Print BASIC Error Message gids.rs@sasktel.net - 2019-01-30 21:05 -0800
Re: Call Address to Print BASIC Error Message Tom Porter <laseractiveguy@gmail.com> - 2019-01-31 00:35 -0800
Re: Call Address to Print BASIC Error Message kegs@provalid.com (Kent Dickey) - 2019-01-31 21:58 -0600
Re: Call Address to Print BASIC Error Message Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-01-31 22:31 -0800
Call Address to Print BASIC Error Message Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-01-31 23:01 -0800
Re: Call Address to Print BASIC Error Message awanderin <awanderin@gmail.com> - 2019-02-02 11:32 -0700
Re: Call Address to Print BASIC Error Message Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> - 2019-02-02 22:56 -0500
Re: Call Address to Print BASIC Error Message gids.rs@sasktel.net - 2019-02-03 10:19 -0800
Re: Call Address to Print BASIC Error Message Michael Barry <barrym95838@yahoo.com> - 2019-02-04 00:42 -0800
Re: Call Address to Print BASIC Error Message Michael Barry <barrym95838@yahoo.com> - 2019-02-04 00:31 -0800
Re: Call Address to Print BASIC Error Message Jeff Blakeney <CUTjeffrey_blakeney@yahoo.ca> - 2019-02-04 10:27 -0500
Re: Call Address to Print BASIC Error Message Bill Chatfield <billchatfield1@gmail.com> - 2019-02-09 09:28 -0800
Re: Call Address to Print BASIC Error Message Michael Pohoreski <michael.pohoreski@gmail.com> - 2019-02-09 13:57 -0800
Re: Call Address to Print BASIC Error Message Michael Barry <barrym95838@yahoo.com> - 2019-02-04 01:06 -0800
csiph-web