BASIC weirdness
Alan Adams (2486) 1147 posts |
I had occasion to want to write out a lot of debugging data. To simplify this I defined a PROCdumprunning(label$,count%). It starts with another PROC reference. Calling this did nothing, even when I put a deliberate mistake in it. *reportdump proc showed PROCdumprunning, immediately followed by ENDPROC. I changed the name of the proc to PROCshowrunningstat(LABEL$,COUNT%) and now the PROC is executed. I didn’t think any lowercase text was reserved. “dump” seems to be an exception. |
Martin Avison (27) 1491 posts |
I do not think dump is reserved in any way, but not at home to check. |
nemo (145) 2529 posts |
There are no reserved words in PROCFNlabels. Please don’t imaginatify explanations for things you don’t understand. That’s how gods happen. |
Paul Sprangers (346) 523 posts |
How would we ever find explanations for whatever in the first place? |
Alan Adams (2486) 1147 posts |
So some more testing, and I’m even more confused.
Calling it in the main program fails to execute anything. I can confirm this by adding “GARBLE” as the line immediately before LOCAL. No error is reported. Using *reporttrace proc (yes, Martin, I did get that wrong before) shows that the PROC is executed, and immediately followed by ENDPROC. I have set up a test program which just contains the function, and enough code to call it. This works. So the question now is: What in the main program could cause a function to return immediately, until its name is changed, at which point the content of the function is executed? I have tried increasing the memory used (using END= as in all these programs), but that makes no difference. Changing the name back to dumprunning again causes failure. Change it to runningstat and it works. The two names are thew same number of characters. Changing it to disprunning (same initial, same length) and it works. dummrunning works. |
Steve Fryatt (216) 2103 posts |
More than one definition for |
Alan Adams (2486) 1147 posts |
Thank you. And thanks to !Locate, I found the other one, in a different file, but linked. Martin: If you are in the mood for making improvements, it would be nice if reporttrace could report the file (main or library) where the report is coming from. Reportstack would be easier to interpret with this information too, though I suspect in that case it’s impossible. |
Dave Higton (1515) 3497 posts |
Science. |
Paul Sprangers (346) 523 posts |
How would we ever find explanations for whatever in the first place? Science exists by the grace of imagination. |
Colin Ferris (399) 1809 posts |
Do people ‘Dream’ inventions – I wonder. Like being able to Fly. Space flight – Dan Dare etc. [Edit] Watching someone fly by running down a field by the cliffs – with nothing more than looking like a silk sheet and some cord. Whee – could have been done Thousands of years ago. |
Steve Pampling (1551) 8155 posts |
It seems Pratchett still lives… Would a god of RO be small and not use much power? |
Bryan (8467) 468 posts |
Like a Raspberry Pi? |
Steve Pampling (1551) 8155 posts |
I suspect that has too many followers to be one of the Small Gods |
nemo (145) 2529 posts |
Occam’s Razor > LSD.
Little Devils. |