Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64_Convert - To fix programs using $NOPREFIX
#1
As was mentioned here earlier, the metacommand $NOPREFIX, which allows use of new QB64 Phoenix functions, datatypes, and keywords, is deprecated and is likely to be removed in a subsequent release of the IDE and compiler. To help with this migration, I have written a program that, when given a QB64 Phoenix source file, fixes any keywords that require a _ prefix, and don't have it. identifiers that already have the _ prefix are unaffected.

It's a bit long to post here at about 400 lines, so you can download a copy off my repository at https://github.com/electric-socket/QB64_Convert. It is pretty much plug-and-play, load the program, compile and run it (or run the included executable), give it the name of the existing file, then where to save it, and within about 2 seconds the conversion will be completed. The program locks the old file in read-only mode until finished, so you can't accidentally delete or overwrite the original file.
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#2
Ha, now we have 2 converter programs!

The next release of QB64PE will automatically offer to remove $noprefix and add back the underscores if you load a $noprefix program in the IDE.

EDIT: if you would like to try the converter that will be shipped in the IDE as a stand alone program, it can be had here: https://github.com/QB64-Phoenix-Edition/...prefix.bas
Reply
#3
Still some glitches in your tool @TDarcos, mainly keywords which are valid with and without the underscore depending on the context:

e.g.

EXIT > _EXIT is ok, but EXIT SUB > _EXIT SUB is wrong (applies also to EXIT FUNCTION, EXIT DO, EXIT FOR etc.)

also watch out for metacommands

$CONSOLE:ONLY > $_CONSOLE:ONLY is wrong

also $COLOR:0|32 color name constants needs to be processed with or without their respective type suffixes:

NP_Red must become Red
NP_Green must become Green
NP_Blue must become Blue
NP_Blink must become Blink

And to be the King, any used $INCLUDE files should be processed too, recursively of course.
Reply




Users browsing this thread: 2 Guest(s)