Nodtveidt wrote:Most of normal QB will compile in FB. Older versions of FB are better for it though, as the compiler's gotten kind of convoluted lately.
Below are portions of the compiler change log that specifically target QB compatibility related issues since the addition of "-lang qb" in version 0.17.
These updates were made throughout the version 0.17 up to version 0.18.4 (SVN):
- added the -lang command-line option, to allow language compatibility without keeping FB from progress, see the migrating.txt file (v1c)
- lang qb: DATA should be allowed inside compound-statements (v1c)
- lang qb: MKI/CVI now return 16-bit sized results (counting_pine)
- lang qb: INTEGER (%) and LONG (&) are now, respectively, 16- and 32-bit wide (v1c)
- lang qb: default numeric literals are now assumed to be INTEGER or SINGLE (v1c)
- lang qb: symbols with the same name as keywords are now allowed: dim left as integer: const dim$ = "" etc (v1c)
- lang qb: all data types and functions/keywords not present in QuickBASIC were removed (v1c)
- lang qb: SLEEP(n) expects seconds (feature request #1718012) (jeffm)
- lang qb: INKEY$ returns CHR$(0) as the extended character (feature request #1718012) (jeffm)
- SCREEN now follows the QB syntax in -lang qb (v1c)
- RND is now 100% compatible with QB in -lang qb mode (patch written by counting_pine)
- ERASE is now compatible with QB, that is when ERASE is called on a variable-length array, the bounds information is reset in addition to the data being destroyed (cha0s)
- -lang qb now skips UDT alignment by default (cha0s)
- LOCATE will now accept a full 5 args to be compatible with QB, however the final 2 args have no effect (cha0s)
- STR will now pad positive numbers with a single space, as in QB, but ONLY if -lang qb is used (cha0s)
- OPEN now is more compatible with QB, the file/device is parsed at runtime (cha0s)
- fixed #1790722 - INPUT wasn't prompting with a '?' if no prompt string was given (cha0s)
- lang qb: STICK(n) and STRIG(n) functions (jeffm)
- added error when NEXT var does not match FOR var (jeffm)
- added First version of COM/serial support for DOS, W.I.P. (jeffm)
- cursor support for INPUT/LINE INPUT in GFX modes (v1c)
- 'PCOPY [srcPg] [, dstPg]' and 'SCREEN [, activePg] [, visiblePg]' for non-graphic, console, screen 0 mode - for DOS and Windows only (v1c)
Although fbc-0.16 most certainly broke stuff, since version fbc-0.17 there has been an on going effort by all developers to improve QB compatibility. Of course some popular "Normal QB" won't compile, but the common issues are on the TODO list.
Last released version of fbc is 0.18.3.
EDIT:
The items listed in the changelog above were made in versions 0.17 through 0.18.4 (SVN).