Metacommand - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Metacommand (/showthread.php?tid=2887) |
Metacommand - eoredson - 07-27-2024 Hi, I have an issue with a metacommand: $Checking:off does not allow a line number: 100 $Checking:off Could some QB64PE editor add the possibility of a line number? Thanks, Erik. btw: actually none of the metacommands do. except for $Dynamic $Static and $Include which require Rem.. RE: Metacommand - TerryRitchie - 07-27-2024 Why would metacommands need line numbers? In fact why use line numbers at all except when dealing with loading/editing legacy code? I'm not trying to be flippant, it's just that I don't think I've seen anyone creating new projects in the last 10 years using QB64 and line numbers. RE: Metacommand - bplus - 07-27-2024 good question @TerryRitchie I await to see if Erik does have good reason. How can it be a compatibility issue with new meta's??? Maybe Erik is coding something that requires Line Numbers for everything? He does seem a bit stuck in the past IMHO. Don't mean disrespect because I am same in reuctance in not exploring _GL nor memory stuff. RE: Metacommand - eoredson - 07-28-2024 My reasoning is thus: The code is for Strek from bcg.zip of David Ahl.. (in the games forum). It is not only QB backward compatible but the original source is line number oriented for basica.com so I left the line numbers in.. Then I noticed the metacommands not being supported.. No great deal but an interesting question! Erik. RE: Metacommand - TerryRitchie - 07-29-2024 (07-28-2024, 11:44 PM)eoredson Wrote: My reasoning is thus: You can simply enter a metacommand in between line numbers without affecting the flow of a program. Even if you could put a metacommand on a line number you would not be able to run the modified code in GW-Basic (BASICA) any way. In other words, QB64 code (metacommands in this case) is not backwards compatible with GW-Basic. 10 CLS 20 PRINT "COUNT FROM 1 TO 32767" $CHECKING:OFF 30 FOR I = 1 TO 32767 40 PRINT "I"; 50 NEXT I $CHECKING:ON RE: Metacommand - eoredson - 07-29-2024 The other thing about $Checking is: Code: (Select All)
that checking off will decrease the .exe by about 200K but overrides the timer!? Actually this code will hang: Code: (Select All)
RE: Metacommand - SMcNeill - 07-29-2024 Of course it will hang. You turned off all error checking and error handling, and then you toseed an error. What did you expect to happen? It's just like tossing all the food and drink out of your house to have a cleaner, barer home. And then you get hungry, and open the fridge to.... just do nothing but drool in hunger. Checking:off only goes around code that you KNOW is 100% error free. RE: Metacommand - DSMan195276 - 07-29-2024 @eoredson I would clarify that `$Checking:Off` makes code smaller and run faster by removing the code that runs the error handlers, runs timers, runs `On X`, etc. between each line. It's not a general purpose "make the code faster" command, it's for the specific use-cases where the event checking is negatively impacting the performance of a piece of code and you know that the event checking is unnecessary for that part (Because it runs fast enough to not impact timers, won't produce errors, etc.) I would additionally note that most commands check if there is a pending error before doing anything, so if an error does happen during a `$Checking:Off` block that can basically disable all the code until the program runs a line in a `$Checking:On` section. |