Weird BASIC is weird
Pages: 1 2
Rick Murray (539) 13840 posts |
Just to ram the point home with an industrial pile driver…
Save it as “ Maybe nemo or Steve know about some little quirk that this could upset – but generally speaking if you don’t use line numbers, they’re just not an issue. When I used to use Edit to write BASIC, I had it set to strip line numbers. When I use Zap, line numbers exist (different method of dealing with BASIC), but I tend to tell Zap to just hide them. I’ve not had to concern myself with line numbers in BASIC since, oh, 1988 or so. |
André Timmermans (100) 655 posts |
RESTORE ? |
Rick Murray (539) 13840 posts |
:-) |
Clive Semmens (2335) 3276 posts |
How many people really use RESTORE n? Surely that’s as much an anachronism as GOTO and GOSUB? (RESTORE +/-n is better, as is RESTORE DATA. Not that I use any of them very often.) |
Steve Drain (222) 1620 posts |
Yes, indeed. One of the requirements of Basalt is that programs are ‘well-formed’, ie |
Steve Drain (222) 1620 posts |
Error reporting is a little tricky without line numbers. |
Steve Drain (222) 1620 posts |
Just to clarify, |
Rick Murray (539) 13840 posts |
;-) Thank you for spotting the obvious bright pink elephant in the room. Line numbers aid debugging. Heck, line numbers are so unimportant that BASIC will only report it by itself if you’re running from the command line. Otherwise it’s just “Mistake” or whatever with no line number quoted… |
Dave Higton (1515) 3526 posts |
The first line of my BASIC progs is always something like this:
|
Steve Drain (222) 1620 posts |
Mine is most often:
Thank you Martin. ;-) |
Steve Fryatt (216) 2105 posts |
Yes… There’s a surprising amount of stuff like this out there. The RISC OS source tree contains a lot of files where the line numbers are all zero, as I recall. I think they’re generated by a version control tool of sorts. Or, as someone wrote in a manual a while back…
|
nemo (145) 2546 posts |
10 LIBRARY"uggh" 20 PROCdoodah 30 END 40 50 PRINT"Oh god" 60 ENDPROC 10 REM uggh 20 DEFPROCdoodah 30 GOTO 50 40 nope 50 PRINT"really, nope" 60 ENDPROC |
nemo (145) 2546 posts |
And therefore 10 REM There's better ways of doing this 20 PROCcallback(1,10,60) 30 PROCcallback(90,100,70) 40 END 50 60 =X%*10 70 =X%-89 80 90 DEFPROCcallback(L%,H%,G%):LOCALZ% 100 FORZ%=L%TOH% 110 PRINTFNcallback(Z%,G%) 120 NEXT 130 ENDPROC 140 150 DEFFNcallback(X%,G%):GOTOG% |
nemo (145) 2546 posts |
“But nemo! You can’t have line numbers as parameters because renumbering wrecks it!” Weeeeeeeeell… |
Clive Semmens (2335) 3276 posts |
I think I know why I’ve never crashed into any of these quirks: I never try to do daft things just to see what happens. Perhaps I should sometimes. It’s not as though I avoid doing daft things in other areas of life. |
Steve Drain (222) 1620 posts |
I suspect the use of ™. |
Steve Drain (222) 1620 posts |
I rather think they are essential. You may not use BASIC |
Rick Murray (539) 13840 posts |
Well, wouldn’t it be nice if such a thing was possible for languages that don’t have any concept of line numbers, like assembler or C…oh… wait… |
Tristan M. (2946) 1039 posts |
I feel I may regret this question, but what editor is nemo using? |
Rick Murray (539) 13840 posts |
I don’t think it has a name. It is one that he created himself in a language that he developed for the purpose of expressing perfect code. It’s a tonal language designed to represent pure thought, and as such any transcription into mere characters and symbols will lose so much meaning as to be relatively useless. You cannot even print out a disassembly of the program because of long complicated stuff that basically boils down to a version of Heisenberg’s uncertainty principle; suffice to say that his editor and his version of RISC OS interact in a symbiotic manner. That’s why he hasn’t blessed us with any of his goodies. They wouldn’t work. Our inferior brains just aren’t up to it. The best we can manage is to look at animated GIFs and think “oh pretty”. |
Patrick M (2888) 126 posts |
Nemo, do you have any plans to release the software in your screenshot? |
Steve Fryatt (216) 2105 posts |
I’m fairly sure that the software in Nemo’s screenshot, far from being anything “special”, is Zap in BASIC mode with the button bar enabled. |
nemo (145) 2546 posts |
Indeed, that’s just Zap. The clever wheeze was getting BASIC to accept tokenised line numbers as parameters, and the rather intractable problem of how you’d persuade the tokeniser to know when you meant a line number and when you meant some other integer. Some other syntax would be required. |
Pages: 1 2