Status of Zap
Chris Hall (132) 3559 posts |
When you get an error report ‘Variable not found at line 12751’ after you have just printed the entire programme out, then added line 12751 to ‘correct’ a bug then get the error, an editor that strips line numbers is not much use. I’ll try the ‘strip line numbers OFF’ option – if I add a line between two lines, will it automatically add 1 to the previous line number if there is a gap? |
David J. Ruck (33) 1636 posts |
Printed out the entire program? |
Steve Pampling (1551) 8172 posts |
Ah, now you confused Mr Fryatt with the “line number” concept, but printing? Printing?
I believe every editor in use in the last [mumble] years has had a line number/identifier increment facility. I’m not sure why you need that when Throwback options exist – as pointed out by Fred Graute in 2016 Joe Taylor wrote !Throwback in 1992 (the version converted is from 1993) it was modernised by Mr Ruck1 in 2003 1 “Mr Ruck” – that’ll confuse him. |
Chris Hall (132) 3559 posts |
Yes. When I am debugging I print out the entire programme, with a cross reference listing of variable usage and scribble on it as I try to debug it. I keep the printout along with various annotations, trying to add lines without affecting the line numbering (i.e. adding xxx1 to xxx9). I then use ‘fc’ in DOS to compare the programmes to print out a list of the changes. Just printed out SatNav, 116 pages. |
Steve Pampling (1551) 8172 posts |
Commenting, with references to external documents. I suppose in a proper DDE that would be comments with links to documents. Electronic documents that is.
Have you never considered SideDiff – you’re staying on RO then |
Martin Avison (27) 1494 posts |
Throwback is very useful when developing BASIC programs, and the source is available when the error is raised. However, if the error report came from another machine – eg a user machine – Throwback does not seem to work! In that case an indication of where in the thousands of possible lines the error was raised is invaluable. So like Chris, I find the emphasis in StrongEd of hiding and changing BASIC line numbers difficult. But I cannot remember when I last printed out a whole program! |
Steve Drain (222) 1620 posts |
By default 1, yes, but if you are insisting on showing line numbers it would probably be better to enter the number at the beginning of the line yourself. Do note that BASIC does not care about line numbers in normal 2 operations and you can enter any in-range number you like. You could even number in descending order. ;-) 1 I have been using StrongED since I paid Guttorm for it decades ago and I have not used line numbers since. The default is to strip line numbers and to save from 1 in increments of 1 and I have never seen any reason to change that. I only came to throwback with Cy Booker’s DDEUtils substitute, because that module itself was only available with the highly-priced DDE, but have not looked back since. ;-) 2 Not-normal would be line references in GOTO, GOSUB and RESTORE, which we never use, of course, or error reporting. For the latter the SE default is ideal as physical lines in the display and BASIC line numbers correspond. Edit: ‘logical lines’ > ‘physical lines’ – SE notation still confuses me here. ;-) |
Rick Murray (539) 13851 posts |
I think the last time I printed out an entire program was prep (homework) back in ‘89. But like listings on my blog, that’s not for me, it’s for somebody else. I have printed out a function that’s problematic, but never an entire program. As for the annotations, I’d be inclined to say that if it is important enough to write down, it’s important enough to add as a comment into the code. |
Grahame Parish (436) 481 posts |
Years ago, back in Prestel/Micronet & acoustic modem days, I wrote an ADFS floppy disc menu system. Originally in BASIC, it used three files – the program, the data and !Boot, so I decided I should rewrite it in 6502 assembler so that I could condense it down to a single file with the data block appended after the code. I printed off the entire listing and then rewrote it assembler by hand alongside the original code before typing it all in. The only real error I made was counting up loops – I soon realised it was more efficient to count down and check for zero. That was my first assembler program and I sold it via Micronet. |
Steve Drain (222) 1620 posts |
A handy trick is to put a |
Alan Adams (2486) 1149 posts |
Throwback is useful, but in my system that uses a lot of libraries, it occasionally creates a throwback in the wrong library. Line numbers? You mean the things that prevent you pasting in a block of code from elsewhere? That prevent you re-organising the code? At least when BASIC reports “error at line 535”, in StrongED pressing F5 and entering 535 goes to the line concerned. If I remember right, in Edit you have to add a 0 to the number. Incidentally if using libraries, it helps to have the first line “REM |
Steve Drain (222) 1620 posts |
Strictly speaking that should be Historically this also applied to ArmBE and Twin, I think. For error reporting BASIC ignores spaces and the Edit: The use of |
Dave Higton (1515) 3534 posts |
What? I’ve never experienced any of that, and I very often paste in blocks of BASIC, and I often reorganise it too. I use Zap. Maybe such problems are caused by another editor? |
Dave Higton (1515) 3534 posts |
I’m mystified by all this talk of problems related to BASIC line numbers. I use Zap, and the line numbers are taken care of completely automatically. I have them displayed when I edit, for two reasons: 1) So I can remember where to scroll to when I’m looking for a function I’ve just been looking at but have moved away from. 2) All my BASIC apps start with a line something like this: ON ERROR PRINT REPORT$ + " at line " + STR$(ERL): PROCclose: END which tells me where the error occurred, so I can go straight to it. There’s another line immediately after the call to Wimp_Initialise so that the same message is instead reported properly via the desktop, and sometimes also a call to get the error reported to my mobile phone. |
Chris Hall (132) 3559 posts |
I use Zap, Zap is fine. The deficiency is in StrongEd. |
Rick Murray (539) 13851 posts |
I think it is worth pointing out that there is a fundamental difference between the two editors. StrongEd is like Edit in that BASIC is degraded to plain text upon loading, and retokenised back to BASIC upon saving. If line numbers are not present, the program will be renumbered upon saving, using whatever method has been configured (1,2,3.. or 10,20,30.. etc). Zap, on the other hand, works with raw BASIC. So turning line numbers on and off doesn’t alter the numbering. Adding too many lines might, but that’s a different issue. ;-)
Not necessary. Zap does the same thing in BASIC that it can do in C – press Shift+Ctrl+H and it will give a list of functions. Double-click to jump to it. The only reason I have line numbers visible in Zap is because I have not bothered to configure it otherwise. I never had them showing in Edit, and when programming in C or assembler, such things don’t exist.
Well, there’s above and beyond the call of duty! :-) |
Steve Pampling (1551) 8172 posts |
Alan, if you read the Help file in !Throwback you will see that is an action that depends on the setting of a variable.
Rick, the realist in me says that the correct version of that statement is “that’s how BASIC tells you where one has screwed up.” |
Rick Murray (539) 13851 posts |
Yes, because BASIC only reports things that the interpreter fails to parse. It won’t say a word about gibberish broken defective code as long as it is valid BASIC (more or less 😉). So, one could say there does exist a “when not” state of error. I suspect that I might be overthinking this. |
Steve Pampling (1551) 8172 posts |
Yup. |
Chris Hall (132) 3559 posts |
At least when BASIC reports “error at line 535”, in StrongED pressing F5 and entering 535 goes to the line concerned. What does it say if there is no line 535, just 530 and 540? Does it go to one of those or does it give an error ‘Line 535 not found’? |
David J. Ruck (33) 1636 posts |
With this talk of BASIC error handling, I remembered I used to use a handler which generated throwbacks, so I could go straight to the suspect line in the editor. I found it last night, but it no longer works. The critical line is |
Steve Pampling (1551) 8172 posts |
Did you remember that you had updated !Throwback and put it on the ARM Club pages here? |
David J. Ruck (33) 1636 posts |
Thanks Steve, I hadn’t remembered! Anyhow, grab that and in your program use:-
If !Throwback isn’t running it will fall back printing out the error message and line. |
Martin Avison (27) 1494 posts |
You can also achieve throwback if Reporter is running and you simply put |
GavinWraith (26) 1563 posts |
The ———————————————————Joe liked to put stuff in ResourceFS, as it was conveniently out of reach of most of the students who would be using it in computing classes. Is this the one on the ARM club pages? |