Hi Kathleen,
I also think that DEBUG as a variable is totally inadequate. But the technique of having a debug flag to activate in certain conditions is good, for example, when you have to debug particular cases of a big billing program. In that cases, what we do is to have a set of debug flags, and even with counters, so you can debug certain number of cases and then let the program run.
You set up, for example, three debug flags, as:
debFlag1 = 5
debFlag2 = 8
debFlag3 = 1
Then, in the branches of the code you want to watch, you place:
if debFlag1 then
debug
debFlag1 -= 1
end
And so on. So, in the example, debFlag1 will fall into the debugger up to 5 times, debFlag2 up to 8, and debFlag1 just once, and then the program will run through without stopping.
Saludos,
------------------------------
Enrique Ignacio Murphy
Software Engineer
Aleator SRL
Argentina
------------------------------
Original Message:
Sent: 03-02-2023 08:36
From: Kathleen Hambrick
Subject: Key Words / variable names
Yup, I've seen some doozies in my day - my favorite was using a variable named 'Debug' - the coder had a line in their program that said 'IF DEBUG THEN DEBUG'. It worked, but YUCK!
------------------------------
Kathleen Hambrick
Programmer at Colwell
Original Message:
Sent: 02-21-2023 02:04
From: Stefano Gallotta
Subject: Key Words / variable names
Hi All,
I'm sure I've posted on this matter before but I just had a bit of a wobble understanding why my code wouldn't compile, until I notice the variable I had used started with the word NEXT (as in Next_Available) and the D3 compile went out and took another shot of tequila and said 'nada - not today hombre'
So, just put it out there NEXT (suffix not allowed) and I'm sure there may be others - like NOT and FOR and ...
Does anyone care to comment?
------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------