Weird BASIC is weird
Pages: 1 2
|
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. |
|
RESTORE ? |
|
:-) |
|
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.) |
|
Yes, indeed. One of the requirements of Basalt is that programs are ‘well-formed’, ie |
|
Error reporting is a little tricky without line numbers. |
|
Just to clarify, |
|
;-) 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… |
|
The first line of my BASIC progs is always something like this:
|
|
Mine is most often:
Thank you Martin. ;-) |
|
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…
|
|
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 |
|
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% |
|
“But nemo! You can’t have line numbers as parameters because renumbering wrecks it!” Weeeeeeeeell… |
|
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. |
|
I suspect the use of ™. |
|
I rather think they are essential. You may not use BASIC |
|
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… |
|
I feel I may regret this question, but what editor is nemo using? |
|
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”. |
|
Nemo, do you have any plans to release the software in your screenshot? |
|
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. |
|
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