If you want to find one of the above quickly, use your text editor tosearch for the text shown above. i.e., Search for "Part 1 -".

As of 12/3/88, all new or changed entries will be marked with the datethat the information as added or changed. The date will appear in theentry in the format (yy/mm/dd).

As of 2/8/89, all references to problems with QB4.00 and QB4.00a havebeen removed from this file. It is presumed that all QB programmershave upgraded either to QB4.50 or QB4.00b. If you are still usingQB4.00 or 4.00a, call Microsoft at 206-454-2030 and ask for a freeupgrade to 4.00b. If you are using BASCOM 6, there is a similar upgradeavailable to BASCOM 6.00b.

This file is maintained by Mark Novisoff of MicroHelp, Inc. Much of theinformation was contributed by members of MicroHelp's BASIC Users Group,users of the MSSYS forum on Compuserve and users of Mach 2, Stay-Res,The MicroHelp Toolbox and the QB/Pro Professional series.

` Next to a QB 4 entry indicates that the problem has been fixed in QB 4.50 and/or the accompanying BC program.

* Next to an entry indicates that the problem has been fixed in QBX and/or the accompanying BC 7.0 program.

Command/Error Compilers Description-------------- --------------- --------------------------------------------$INCLUDE All If the last line of your $INLUDE file does not have a carriage return/line feed pair, spurious errors can occur!$INCLUDE QB 4 If you have a DEFINT statement in an include file and you wish to use it within subprograms/ functions in a module, you must $INCLUDE it within each sub/function structure. If you simply include it in the mainline code, the DEFINT statement is not recognized. However, if you have a statement DEFINT in your mainline code (as opposed to $INCLUDE), it will work ok.BLOAD All When running on an XT with SMARTDRV.SYS, you may find that the BLOAD will display only the first two screen lines. If so, removing SMARTDRV.SYS will solve the problem. (89/12/22)BLOAD All In order to BLOAD a file, the file must have been previously BSAVEd so that the 7 byte "header" is present. Although it may be possible to BLOAD files that were not saved with this header, it is dangerous because BASIC presumes that the header is there and will not load the first 7 bytes into memory. (89/03/31)CALL (asm) QB 4* If you pass a static string array as a parameter to a subprogram, and the string array represents FIELDed data (as in a random file), AND you call an assembly subroutine that displays the data, your position in the file can be wiped out! See sample program #22. The fix is to place the string array in a COMMON SHARED statement and remove it from the parameter list.

Added (88/12/19). Even if the string array is NOT a FIELDed array, the data can become corrupt. The new solution is to move all CALL or CALLS statements that have string arrays as parameters to the MAIN program and remove them from SUBs.CALL QB 4 If you want to pass a single element from a string array to a subprogram, be sure to put an extra pair of parentheses around the variable name in the parameter list. For example, you may have a problem with: CALL MySub(A,B,C$(3),D) However, the following should work: CALL MySub((A,B,(C$(3)),D)CALL (asm) QB 4+/BC6+ Effective with QB 4, assembly language subroutines must preserve the SI and DI registers and make sure the direction flag is cleared before returning to BASIC. In addition, you must not have a label name after the END statement in your assembler code.CALL INIT QB 2-3 Do not name a precompiled subprogram "INIT". If you do, the compiler will go into never- never land when your user library is loaded.CALL vs GOSUB All If you have many calls to the same asm routine or subprogram, you'll use less memory if you set variables and GOSUB to a routine that performs the CALL instead of having the CALL "in line". CALL is much faster using variables than using "literals".CALLS QB 4* If you are passing string arrays to an assembler subroutine, make sure that $Static is in effect (not $Dynamic) when you dimension your array. If you do not, the data are not pushed onto the stack correctly by BC. This affects the use of MhBasStringSort in Mach 2.CALLS QB 4* When CALLS (note the "S") is used and you compile with "/D" (debug), the segment of of a string element descriptor does not get passed on the stack. In other words, if you have an assembly language subroutine that uses CALLS, you should not compile with "/d".CHAIN QB4/BC6* CHAINing from a small .EXE to a large .EXE can cause unpredictable problems. This has been corrected in QB 4.50. (89/07/29)CHAIN BC6.0x* If you are using extended runtime libraries, there are known problems with CHAIN. This includes problems in COMMON SHARED data. (89/07/29)CHAIN BC6.0x BC7.0 Contrary to the docs, the stack size is *not* preserved across a CHAIN. The workaround is to use the /ST:xxxx switch when LINKing your programs. (89/07/29) CHAIN QB 4, QB 3 & CHAIN and RUN will work correctly in DOS 2.1 BASCOM 6 when you compile with the BRUN library. They will not work correctly on the second CHAIN or run attempt if you compile with the BCOM library (/O). You will get one of the following errors: Out of memory, EXE failure, or Error R6005. (89/04/24)CINT QB 4/QBX If the number you want to convert is exactly halfway between two integers (i.e., .5), the rounding is done incorrectly when the number that would normally be the result is an odd number. See example program #30. (89/01/03) It turns out that this works exactly as Microsoft designed it - for statisticians. If the whole portion of the number is odd, the number is rounded up. If the whole portion is even, the number is rounded down. (89/11/03)CIRCLE QB 4/QBX The start and end angles must be LESS than 2*pi. Previously they could be less than or equal to.CLEAR QB 4/QBX If you use SETMEM to free up memory for use by other routines or modules, the CLEAR statement does not force the compiler to give up that memory. In other words, you must explicitly do a SETMEM(640*1024), or other large number. (Also see RUN.) Added 89/02/08: If you have an assembler routine that has allocated memory from the pool created by SETMEM (Mach 2's huge string arrays, for example), using SETMEM(640*1024) will still not release the memory. That's because the underlying program has may have done its own allocation of memory via DOS. In this case, you must force the assembler routine to free up the memory. In the case of Mach 2's huge string arrays, this is done by telling Mach 2 to release the memory.CLEAR,,Size QB 3,4/QBX If you receive an out of stack space message. The stack size is reset between CHAIN'ing but if you CHAIN back to your original program, be sure to skip the CLEAR instruction. Added 89/02/08: This is very important in QB4 if you have recursive subprograms and/or functions. "Recursive" means that the procedure can be invoked from inside the procedure.COMMON and QB 2-4/QBX All statements that use COMMON or variations COMMON SHARED thereon with CHAIN must use parameter lists that match exactly. Best done with $INCLUDE.COMMON with TYPE QB 4/QBX The TYPE statement must appear before the COMMON statement and must appear in all programs that use it. The COMMON statement must contain "AS". See sample program #1 at the end of this file.Compile to EXE QB 4`* QB issues an unusual LINK command in the form of: LINK Prog+YourLib.Lib; This causes LINK to bring the entire library into your program! The solution is to exit QB, and run BC and LINK yourself. Note also that the LIB environment variable is not used to search for libraries in this context, since the library name is in the object module field.CONST QB 4* Must be included in all program modules that use the constant. Place in the file at the top, rather than inside SUB's.DATA BC4.00b/6.00b* See READDATA QB 4/QBX When a DATA statement is encountered inside a SUB...END SUB structure, QB moves it into the "mainline" portion of the code when you are in the environment. DECLARE QB 4/QBX QB4 allows you to use a procedure name as a label. See example program #32. (89/02/10)DEFINT QB 4 See $INCLUDE.DEF FN All These functions cause temporary strings to be held in memory. See example program #36. (89/10/10)DEF FN All Functions are local to the module in which the DEF FN appears. Use QB 4's FUNCTION..END FUNCTION for global functions.Device Unavailable (QB4+) This error has been reported, especially when using a fast machine (such as a 386), even though the device is present. The problem appears to be a matter of timing. The solution is to use error trapping and if "Device Unavailable" occurs, retry the OPEN statement three or more times. (90/01/19)DIM QB 3 See sample program #4. QB3 apparently has a limit of 123 dynamic arrays.DIM QB 4/QBX Any array that is DIMmed inside of a subprogram that does not have the STATIC keyword is a DYNAMIC array. DIM QB 4/QBX In order to take advantage of the /AH switch with TYPE..END TYPE records, the record length must be a power of 2 (4,8,16,32, etc.)DIM QB 4/QBX Static numeric arrays are stored on the "heap" when you are inside the QB environment. BC programs store them in the default DS.DIM (TYPE) QB 4/QBX See sample program #1 for dimensioning arrays of TYPE'd variables.Division All Using integer division "\" when an integer result is desired is much faster than normal division "/".DRAW QB 2-4 Does not respect the boundaries designated by WINDOW.Duplicate Definition QB 4 If you receive an otherwise unjustified "Duplicate definition" error, check to see if your program has variables called F$ or F%. When programs reach an undefined "critical mass" (in terms of size), variables using those names will cause the error. The solution is to find and replace all occurrences of those names with other names. (88/12/03) Added 89/02/08: These variable names can also cause "FUNCTION not defined" errors.ENVIRON QB 2-4/QBX If you attempt to create a new environment variable inside a program, you are likely to get an "out of memory" error, because the amount of environment space available when your program runs is very small. To get around this problem, create a good sized dummy variable in your AUTOEXEC.BAT, then inside your program, eliminate it before attempting to setup new variables. Eliminate the variable by using the semicolon: ENVIRON "DUMMY=;".Error R6005 See CHAIN (QB 4) (89/04/24)EXEC Failure See CHAIN (QB 4) (89/04/24)Expression Too Complex QB 4.50/BC7 QB will generate this error if you try to concatenate more than 19 expressions. BC will do the same, but it may point to the wrong line. Specifically, if the BC4.5 compiler gives you this error, check the line *above* the indicated line. You may even get this error when the offending line has been REMmed. (89/07/29) This problem has been fixed in QBX, but still exists in BC 7.0.Far heap corrupt QB 4 When working in the environment, this error can occur when you are *saving* a file that uses several user-defined types and arrays in COMMON. (89/03/31)/FPA BASCOM 6/7 If you use VAL on a string "E9999" (or a similar string with a leading "E") and you compile with /FPA, you'll get an overflow error. Compiling without /FPA yields a VAL of zero. (89/03/31)/FPA BASCOM 6/7 If you use the /FPA switch (alternate floating point math library) when compiling one or more modules, you must use the same switch in ALL modules in the same program.FIELD QB 4 We've had a report that if you use array elements for FIELD'ing a Btrieve file, and you don't DIM the string array (i.e., you default to 10 elements) that you can get string space corrupt errors. The solution is always to DIM the arrays.File not found All See KILL (Network).FILES QB 3 There is a bug in the QB3-8087 compiler that causes FILES not to work correctly.Fixup Overflow BASCOM 6 If you include the Microsoft mouse object module (MOUSE.OBJ) in an extended runtime library, you will get a fixup overflow error. There are two solutions: Put MOUSE.OBJ in your program instead of the ERL, or use an alternate set of mouse routines, such as those in MicroHelp's QB/Pro Volume 4. (89/03/31)FOR/NEXT QB 4/BC7 If you use an integer for a loop counter, and the top of the loop is 32767 (when STEP is positive) or the bottom of the loop is -32768 (when STEP is negative), you'll get an overflow when inside the QB environment or when compiled with BC using "/d". With BC,if you don't use "/d", the loop does not stop at the top/bottom - it wraps around and executes your loop indefinitely.FRE(-2) All Fre(-2) is unreliable in all versions of QuickBASIC 2-4. See sample program #26. The BC 7.0 documentation explains this. (89/11/03)FUNCTION QB 4 Provides global functions for all modules in a program. All that is needed is a DECLARE statement in any module that needs to use the function. In addition, this type of function can be recursive. See DEF FN.FUNCTION QB 4/QBX/BC7 Cannot be used in $INCLUDE files.GOTO QB 4` See sample program #17.HEX$ QB 4/QBX/BC7 Be careful when using with non-integer values. For example, the output from the two lines shown is "FFFF8002". E&=&H8002 PRINT HEX$(E&)IF..THEN..ELSE QB 3 More than two nestings for ELSE on a single line will not compile properly.IF..THEN..ELSE QB 4 ` See Sample program #9.INPUT QB 4 ` Using INPUT directly to an array element that should generate a "subscript out of range" error causes a hard crash. LINE INPUT generates the error just fine. Note that this error occurs only inside the environment. See Sample program #10.INSTR BC 4.x See Sample Program #37. (89/10/12)INT QB 4/QBX/BC7 See Sample Program #29. (88/12/19)Internal Error QB 4` More problems with long integers. See sample in BC program #25. KILL (Network) All If you get a "file not found" error when attempting to KILL a file on a network drive, and you know the file exists, the problem is most likely due to the user not having "delete" rights in the network. In this case, the network will issue an "access denied" error, which BASIC will translate to "file not found".LIB.EXE n/a LIB cannot recognize the name of a library if you precede the library name with a path that contains a hyphen "-". For example, if you enter the following, LIB will fail: LIB Test-Dir\MyLib LINE All* LINE does not respect the boundaries set with VIEW if you draw a filled box with LINE. See sample program #38.LINK with /PAC See sample program #31. Note that the /PAC switch is supported only by the latest versions of LINK. (89/02/10)LINK All Use the /EXEPACK switch to condense the file. Can be used on any program except programs that are CHAIN'ed to using all compilers except QB 4/BC7. All QB 4/BC7 programs can use this switch. Syntax: LINK /EXE Progname (etc.)LINK QB 4 When building a Quick Library, be sure to specify BQLB4x in the library field. Example: LINK /QU ObjMods,Lib,,BQLB40; This also applies to BQLB41 if using BC6 or QB 4.00b and BQLB45 when using QB4.50. Similarly, with QBX use QBXQLB.LOAD QB 4/QBX/BC7 If you receive an "out of memory" error, try breaking your program into logical pieces (using subprograms). Then use COMMON SHARED for all variables that you need in the entire program. The exact same COMMON SHARED declaration must appear in all the modules in the program that need access to the variables.LOAD QB 4* If you download a QB 4 program in "fast load" format, many modem transfer protocols pad the file out using a number of CHR$(0)'s. This will cause QB 4 to crash when you attempt to load the program. Use DEBUG to view the file, then write the program to disk after changing the CX register to shorten the length of the file so that the trailing CHR$(0)'s are not included. The other solution is to download this type of file using an ARC program that restores the original length of the file.LOCK QB 4 If you LOCK records, then perform a SHELL, then you try to UNLOCK the same records, you may get a "permission denied" error (error 70). (88/12/19)LPRINT QB 4.50* See TAB with REDIM (QB 4.50)ON ERROR QB 4` See "RESUME" for QB 4.ON ERROR QB 2-4 Error handler routines must be located outside SUB...END SUB structures. You can RESUME to a line number/label that is outside SUB...END SUB structures (using /E) or to code inside the sub using plain RESUME or RESUME NEXT (/X). Much better is to $INCLUDE subroutines that perform error trapping instead of having them in subprograms. This allows the use of RESUME line number/ label and avoids the /X. Note - with BASCOM 6 and QB 4.00b, error handling has been improved. See the docs. BC7 has "ON LOCAL ERROR", which is even better.OPEN COM QB 4` If you compile with /S, and use OPEN COM with a literal string, the statement will generate "Device Unavailable". See sample program #18.OPEN All With Novell NetWare, using OPEN on a file that does not exist does not always create the file. Novell has acknowledged the problem but they don't have a solution available as of 12/19/87. A workaround for the problem when using Btrieve is to open the NUL device on the local system instead of the network. For example, OPEN "R",1,"A:NUL".Out of memory QB 4 BASCOM 6 See CHAIN (QB 4)Overflow All BASIC uses integer types for all calculations and processes the right side of the equal sign before the left side. To force BASIC to use a different numeric type, place a type identifier on the right of the equal sign. Example: A=Peek(2)+256!*Peek(3)PAINT QBX/BC7 PAINT can't handle a CHR$(0). See Sample program #3. (90/02/17)Periods in variable names QB 4* We have found numerous problems using periods in variable names. We believe the problems are somehow associated with TYPE..END TYPE user defined records. Because of these problems, we recommend that you do NOT use periods in variable names. See sample program #28 for one example of this problem. (88/12/03)PRINT CHR$(128) QB 4.50 If you have a program that contains a PRINT "" and you save it in "fast load" format, BC4.50 will not compile it. The solution is to save your programs in text format. (90/02/20)PRINT QB 4.50* See TAB with REDIM (QB 4.50)PRINT All Try this program in QB: (89/02/10) FOR N = 29 TO 31 PRINT N, CHR$(N) NEXT The number "N" will print just fine, but the characters will not. In order to display these characters, use an assembler subroutine, such as MhScr in Mach 2. PRINT # QB 4 In order to print a blank line using QB 4, use the syntax: PRINT #n, Note the absence of the null string after the comma. We've had an unconfirmed report that if the print buffer is filled, using the null string causes characters to be dropped.PRINT USING QB 4/BC7 With previous compilers, you could place TAB statements, variable names, or most anything else between PRINT and USING. With QB 4, nothing should come between PRINT and USING.PUT 4.00b/BC7 See sample program #21. When using the syntax PUT Filenumber,RecordNumber,Variable you'll get a "bad record length". Added 89/10/07 - see sample program #21 for another solution.READ BC4.00b & 6.00b* RUN does not do an implicit RESTORE. See Sample program #34. (89/07/29)READ QB 4` If you want a REMark on a line that contains DATA statements, be sure to put a colon on the line between the end of your data and the REM or '.REDIM QB 2.01 In EXE programs (not in the environment), the following logic will cause your FIELDed variables to go haywire:

The solution to the problem is to reFIELD the file after a REDIM and a FRE("").REDIM QB 3 If you have a subprogram that REDIM's arrays, and you get a "string space corrupt" message after calling the subprogram several times, try using ERASE on the array before you do the REDIM.REM $INCLUDE QB 4` See sample program #24.REM $TITLE QB1-4/BC7 When you use the REM $TITLE metacommand, you are limited to 60 chars of title. If the title is longer, you'll get an error message "Metacommand error". Note that QB2.01 does not print an error message, but still shows "1 severe error".RESTORE QB 4/BC6 If you have two object modules with the same name (for example, one compiled from TEST.BAS and one from TEST.SUB), and you use RESTORE, and you get an error (or the wrong data) when you use READ, use the '$MODULE metacommand to give one of the modules a different name as far as LINK is concerned. Example: '$Module: 'TEST2' (90/02/26)RESUME All If you always use RESUME or RESUME you can use the "/e" switch instead of "/x". Makes programs smaller! This is not practical for subprograms, so error trapping is better handled in mainline code. See ON ERROR. Note - BC7's ON LOCAL ERROR takes care of RESUME within modules.RESUME QB 4` If you compile to an EXE from inside the environment, a "/X" is generated by QB even though it's not needed. Be sure to recompile with "/E" outside of the environment if your program doesn't need "/X".RUN QB 4 See CLEAR (QB 4) and CHAIN (QB 4)SADD QB 4 When using SADD-188 for Btrieve, be sure to make this calculation EACH TIME you are going to CALL Btrieve. This is because QB 4 can move the FIELD'ed strings around in memory.SAVE QB 4 If you edit a new program and save it, QB defaults to "fast load" format. The file cannot be handled by a text editor. Fix by using "save as".SCREEN (Page) QB 3 If you have a VGA, your system is in 40 column mode, and you use a video page other than 0, you will find that QB3 stores the pages beginning at an offset that is &H100 (decimal 256) higher than it should. Instead of beginning page 1 at offset 2048, (&H800) it starts at offset 2304 (&H900).SCREEN QB 3 If you have a VGA and run the following program, you'll find that your screen has 28 lines! SCREEN 2 SCREEN 0 PRINT "Hello world"

The solution is to use MhDos2 (Mach 2) or CALL INTERRUPT (or one of its variations), with the AH register set to 0 and the AL register set to 3. After that, do another SCREEN 0, and you will have 25 lines.SCREEN All ? When reading characters from the screen using SCREEN (X,Y), if the character on the screen is CHR$(0), 32 (blank space) is returned as the result from this function. Using Mach 2's MHRSCR will overcome this problem.SELECT CASE QB 3 Much less forgiving than QB 4. For example, when using a string, you can't say: CASE CHR$(3) However, you can embed the literal character with an ASCII value of 3 in quotes! SELECT CASE QB 4` If you set a breakpoint (using F9) on a CASE statement, the logic of the SELECT CASE... END SELECT fails. See sample program #19. QB 4.50 tells you that you cannot set a breakpoint on a CASE or END SELECT statement. Some fix!!!SELECT CASE QB 4/QBX You cannot have a line number or label between the SELECT CASE and the first CASE.SHARED QB 4 See sample program #23.SOUND QB 3/87 Generates error 6 in all forms when the emulator is used on non-87 machines.STACK OVERFLOW 4.00b You may get this problem when compiling with BC or BASCOM 6. This is a compiler bug, not an error in your program. Contact MS at 206-454-2030 if you have this problem.STATIC QB 4/BC7 When used with a subprogram, makes the subprogram faster, since local variables are not initialized on each call.STR$(Value) QB 4* Considerably slower than in QB 3. See benchmarks in sample program #7.String Formula Too Complex QB 2/3 These compilers have a 19 item limit on string concatenation. If you have more than 19 variables/literals, you get a "String formula too complex" error. (89/03/31)String Space QB 4/QBX Drops you out to DOS without saving Corrupt your program. The solution is to save often!STRING$ All A$=String$(5,65) takes less code than A$=String$(5,"A") and both are smaller than A$="AAAAA".SUB...END SUB QB 4/BC7 Cannot be used in $INCLUDE files. Cannot have the same name as a variable (regardless of the variable type).SWAP QB4/QBX Swapping *portions* of a user-defined type in the environment can cause a crash during binding. Swapping the *entire record* will not cause a crash. (89/12/22)SWAP with CONST QB 4.50 See sample program #35. (89/09/07)TAB with REDIM QB 4.50* See sample program #33. (89/04/24)Too Many Files ??? A QB user has reported a problem that we are unable to duplicate. He says that the "Too many files" error can occur when a disk is full or there are too many files in the root directory. (89/02/10)Too Many Files 4.00b When you use QB to make an EXE program, if you get this error, it usually indicates that a module's complete file spec (i.e., drive, path and filename) is longer than 60 chars. 60 is the longest name that QB can handle. The solution is to shorten the file name.TYPE..END TYPE QB 4 There has been an unverified problem reported in QB when the record length is an odd number. A "FAR HEAP CORRUPT" error is generated. The problem does not seem to appear in BC, only QB. If you have an unusual, otherwise unexplained problem, try changing the record length to an even number.TYPE..END TYPE QB 4 See "DIM" for QB 4.TYPE..END TYPE (with COMMON) QB 4 See COMMON (with TYPE) and sample program #1.UBOUND QB 2-3 If you ERASE an array, UBOUND will return the upper bound of the array BEFORE it was erased. This works OK in QB 4.UNLOCK QB 4 See LOCK QB 4 (88/12/19)VAL QB 4 BC6/BC7 Much slower than QB3, including when /FPA switch is used. See part 2, under "VAL" for a workaround if you have Microsoft C. If you don't have C, you may want to consider MicroHelp's QB/Pro Volumes 1-4, which have routines that convert strings to integers and long integers. (90/01/08)VAL QB 4 BC6* Generates an error (rather than value of 0) when "e%" or "d%" (case doesn't matter) are the first characters in a string, or when "%" is the first character. (89/04/24)VAL QB 4* When you use VAL("&"), you get 203 instead of 0.WINDOW QB 2-4 Does not affect DRAW statements.----------------------------------------------------------------------------Part 2 - General points of interest----------------------------------------------------------------------------BC7 Type coercion from floating point to integer (90/02/12)

The following program demonstrates a problem when coercing a floating pointnumber to an integer in BC7. The program will work fine in the QBX environment, but returns spurious values for C% when compiled to an .EXE

----------------------------------------------------------------------------BC7 with Inboard/PC and CoProcessor (90/01/08)

Effective with BC7, Microsoft has changed the way they test for the presenceof a math coprocessor (80x87). They now test to see if the motherboardswitch indicating a coprocessor is on or off. The Inboard/PC has to havethe motherboard switch off. This means that BC7 won't recognize a coprocessor on such a system.----------------------------------------------------------------------------VAL Workaround (90/01/08)

If you have Microsoft C, you can take advantage of two functions built intothe C library that will speed up the VAL function when used with integers andlong integers.. In your BASIC program, you need to declare two FUNCTIONs andyou must work with ASCIIZ strings (a BASIC string with a CHR$(0) on the end):

You'll also need to make a "dummy" C program, compile it and include itin your Quick Library (for use in the environment) and on the LINK commandline:

void dummy() int n; long l; char near *ST; n = atoi(st); l = atol(st)

(90/01/18) Another suggestion from the same person is to readnumeric DATA statements into strings and then use the ATOIfunction to get the integer value.----------------------------------------------------------------------------Converting large numbers to integers (89/12/22)

A common technique to stuff a large number (between 32767 and 65536)into a BASIC integer is:

number! = 50000number% = VAL("&H" + HEX$(number!))

However, QB's VAL() function is quite sluggish. The following techniqueproduces the same result, and runs approximately 20-30% faster, dependingon the compiler:

If you are using the Microsoft BASIC Compiler 6 (version 6.00 or6.00b) and are using the default math library (/FPI), you mayexperience unexplained "overflow" errors if your program isrunning on a 286/386 with a math coprocessor AND under DOS 3.2or 3.3. The solution is to use the alternate floating point mathlibrary (/FPA), however:

If you are running on a machine with a math coprocessor,you're using Btrieve 4.x or 5.x, you've compiledwith the /FPA switch, AND your program CHAINs, then youmust perform a Btrieve "reset" (Op%=28) before CHAINingor an "illegal function call" error will result.----------------------------------------------------------------------------AB45ACVR.HLP and QB45ACVR.HLP (QB 4.50) The actual hypertext help file is QB45ACVR.HLP. Some of the entries in the help screens try to find AB45ACVR.HLP instead (i.e., the "Q" is changed to an "A". If you have a hard disk, you can remedy this by copying the "Q" file to the "A" file. (89/04/24)----------------------------------------------------------------------------BUILDRTM (BC7) Has a limit of 127 exports in a single extended runtime library. (89/04/24) Note that the error you receive is "Fixup overflow" when you run the BUILDRTM program.----------------------------------------------------------------------------BUILDRTM (BC7) Has a limit of 255 exports. (89/11/03)----------------------------------------------------------------------------Wyse PC Keyboard Problem

Some early versions of the BIOS used by Wyse incorrectly set a byte in theBIOS data area that tells QB that an enhanced keyboard is present. Thiscauses a lockup, since QB is using an "enhanced" BIOS call to read the keyboard and is not getting a response.----------------------------------------------------------------------------ATI EGA Wonder Cards

If you find that you are unable to set EGA modes on a system with oneof these cards, call ATI for a free BIOS upgrade.

If the QB 4.50 editor seems to be "changing" your programs, includingplacing "garbage" characters on the screen, it may be due to yourmath "coprocessor" (80x87 chip). Two solutions:

1. Check to make sure that the coprocessor chip is firmly seated.2. Make sure that the motherboard switch indicating the presence of the coprocessor is set correctly.----------------------------------------------------------------------------Keeping DTR High QB 4

According to Microsoft, you can keep DTR high when exiting from QB 4.x byperforming the following steps:

1. Close the serial port.2. Immediately perform one of the following statements: a. For COM1: OUT &H3FC,3 b. For COM2: OUT &H2FC,3

The OUT command will force pin 20 (DTR) to stay high. DTR will actuallybe dropped for an instant between the CLOSE and the OUT, but it shouldbe too short for the modem to care. If this does cause a problem, tryadjusting the "S" register (see your modem manual) to allow a largertime-out period before dropping the carrier. ----------------------------------------------------------------------------Logitech Mouse Info QB 4.50 (88/12/19)

When running QB 4.5, if DOS is in 25 line mode and the QB editoris started with the /h option for 43 line mode, a LogitechHi-Rez Bus mouse cursor disappears below line 25. Solution: usethe Microsoft vers. 6.24 mouse driver that came with QB4.5 orget the Logitech vers. 3.43 or later driver. Contact Logitechat 1-415-795-8500. Another solution is to use MODE43.COM fromearlier QB versions to put the screen in 43 line mode beforestarting QB4.5.

After running a program that uses the 25 line mode and a returnis made to the editor, press F4 to review the Output screen andthen press any key to return to the editor. The screen willreturn to 43 line mode but the lines below line 25 will beblacked out. The problem was found to be the Tseng EVA-480 EGAcard. A temporary fix is to do 'Alt-F' and then 'D' to executea shell to DOS and immediately return or else press F5 to rerunthe loaded program to restore the full 43 lines. The bettersolution is to just not use the F4 key until the Tseng card'srom is updated or QB is fixed.

On some "clone" computers, the Cut and Paste keys (Ctrl-Ins) and (Shift-Ins)do not work correctly. There are two things you can try:

1. Turn off Caps Lock, Num Lock and Scroll Lock.2. Run FIXSHIFT.COM with the "/I" switch to force installation.

If neither of the above work, contact Microsoft and let them know whatyour hardware configuration is.----------------------------------------------------------------------------Avoiding unwanted line feeds when printing to LPT

When you LPRINT a CHR$(13), QB4 automatically appends a CHR$(10) charactercausing "unwanted" line feeds. To avoid this problem:

OPEN "LPT1:BIN" FOR OUTPUT AS #1

Then instead of using LPRINT, use PRINT #1,String. This causes the outputto the printer to be "unfiltered". ----------------------------------------------------------------------------DOS 4.00

On August 29, 1988, Infoworld reported several known problems with IBM DOS4.0. Their suggestions include:

1. If you use the DOS "Shell", run it in text mode to avoid conflicts with TSR programs.2. Disk un-fragment programs, such as Norton Utilities, Mac Utilities, VOPT, etc. don't work.3. Lotus Metro doesn't work.4. Don't use the EMS driver that comes with DOS if you have a third-party memory board. Instead, use the driver that came with the board.5. Don't try to install IBM DOS 4.0 on a hard disk that already has a non-IBM version of DOS 3.x.6. Don't use the "/X" switch with any itmes in CONFIG.SYS.

In the same issue, Cringely reports that IBM is working on DOS 4.1. ----------------------------------------------------------------------------Problems when moving SUBs between modules in the environment.

The following is unedited text uploaded by a Compuserve user. Theproblems described have not been confirmed - this is included for yourinfo and so that you can avoid doing what he did.

On SOME occations, QB will not let you save your program,giving instead an "Out of Memory" error. Automatically, youlose everything you've done since you last saved. But uponexiting, you also find that the file was erased from the disk!GONE! Using Norton can RARELY bring it back (usually trying toload the resurected file causes a complete system hang). Thishas happened at least 10 times to me. The program is VERY large(over 1200 lines) with many Subprograms. The most notable cause(but not ONLY) is when moving a SUBprogram from one program toanother (i.e. copying it). When deleting the original SUB linein the target program and substituting the one to be copied(with ), everything appears fine until the next save.This does not always happen, but USUALLY. If I do not removethe original SUB line, it doesn't seem as likely to happen.These are all the clues I have on this one. Also, jumpingbetween programs using ile pen tends to aggrivate theproblem. If I do this frequently, a ile ew is likely togive me a "string space corrupt" or "far heap corrupt" error anddump me back to DOS. Remember, these are large programs, withlarge arrays (the /AH switch).

Pressing Ctrl-P, followed by CHR$(12) (regardless of how you enter it),does not embed a CHR$(12) in the text. However, if you use another texteditor to embed the CHR$(12), QB will display it just fine.

If you mark a block, using the SHIFT and cursor keys, and then you typea space (while still pressing the SHIFT key), your marked block willdisappear.----------------------------------------------------------------------------Scan Codes for F11-F12 and Variations:

When you have a long integer array with two dimensions, BC may not handlethe zeroth elements correctly on machines without a math coprocessorunless you use the "/d" switch. QB handles the situation OK because "debug"is always on when working in the environment.

Secondly, if you dimension the same two-dimensional array using a variablename instead of a numeric constant, BC may not handle your array at all! Thefix is to use only constant numbers in dimensioning the array. Another fixthat DOES work with dynamic arrays, is to use the /R switch when compiling.----------------------------------------------------------------------------More on long integers *

If you pass a long integer array to a subprogram, QB will work OK, butBC does not. See Sample Program #2.----------------------------------------------------------------------------Long Integers and Calculations QB 4 `

Calculations using long integers should be tested thoroughly after compilationwith BC. Sample Program #6 demonstrates the problem.----------------------------------------------------------------------------LIB environment variable

If you set the LIB environment variable, you will find that QB, BC, BUILDLIBand LINK will all search the specified path whenever a User Lib, Quick Lib orLINK lib is needed. The syntax is similar to the DOS Path syntax:

SET LIB=C:\Libs;C:\DOS;C:\QB

Note that this does not have any effect when you are compiling from within the QB4` environment, and QB sticks the name of a library in theobject module field.----------------------------------------------------------------------------Undocumented switches in QuickBASIC 3

QB ProgramName/F compiles the specified program to an EXE file without starting up the QB editor.

QB ProgramName/Z tells QB to load and execute ProgramName and exit to DOSwhen the program ends.----------------------------------------------------------------------------Response files

BUILDLIB and LINK both accept input from response files. This is exactly thesame as redirection of input, but the programs will continue running whenthe end of the file is reached prematurely. Example:

Buildlib will take its input from the response file because the "@" signtells it to! ----------------------------------------------------------------------------BUILDLIB and "too many segments" error

Where "nnnn" is a number from 1 to 1024, use:

BUILDLIB /SEG:nnnn

That increases (or decreases) the number of allowable segments. Default=255.----------------------------------------------------------------------------Entering unusual ASCII values.

If you're not familiar with WordStar, you may not know that you can enterunusual characters into the QB4 editor by doing the following:

Hold the Ctrl key and press "P" once (nothing will happen). Release the Ctrl key. Press and hold the Alt key. Using the keypad number keys (not the keys on the top of the keyboard), enter the ASCII value for the key you want. For example, the 'Esc' key is ASCII 27, so press the "2", then the "7". Release the Alt key, and your special character will appear! ----------------------------------------------------------------------------Part 3 - Sample programs----------------------------------------------------------------------------Sample program #1. How to use COMMON with TYPE'd variables.

----------------------------------------------------------------------------Sample program #2. Demonstrates problem with long integers in subprograms.

DECLARE SUB TestLong (LongArray&())'Demonstration to show difference between return values of long integers

'Returns desired value if compiled in the environment, but not if compiled'by BC.

'This fault only appears if the code is in a subprogram and compiled with BCREM $DynamicDIM LongArray&(10)DIM MainArray%(10)

CLSLongArray&(1) = 100MainArray%(1) = 10

FOR x% = 1 TO 2 LongArray&(1) = MainArray%(1) + LongArray&(1) ' Note: if you change the above into the following two lines, this part ' of the program will run correctly. 'Temp& = MainArray%(1) 'LongArray&(1) = Temp& + LongArray&(1)NEXT

FOR x% = 1 TO 2 LongArray&(1) = IntArray%(1) + LongArray&(1) ' Note: if you change the above into the following two lines, this part ' of the program will run correctly. 'Temp& = IntArray%(1) 'LongArray&(1) = Temp& + LongArray&(1)NEXTEND SUB

----------------------------------------------------------------------------Sample program #3. Demonstrates problem with PAINT in QBX and BC7 whenchr$(0) is used.

' This code erases the yellow line in earlier compilers,' but QBX/BC7 can't handle the CHR$(0) in the PAINT statement.

SCREEN 8LINE (0,0)-(150,150),15,BLINE -(0,0),14PAINT (1,1),chr$(0),15

----------------------------------------------------------------------------Sample program #4. Demonstrates the limit on dynamic numericarrays in QB 3. This program generates a program calledARRAY.BAS. Compile ARRAY.BAS with the "/d" switch, LINK it andRUN it. The sole function of ARRAY.BAS is to generate arrays.Regardless of the value of I%, and regardless if you use "#","%" or "!" as the array type, the program gives an "Out ofmemory" error when the 124th array is DIMmed.

OPEN "O",#1,"ARRAY.BAS"PRINT #1,"I%=1"FOR J=1 TO 126 L=L+10:PRINT #1,MID$(STR$(L),2);" DIM A";MID$(STR$(J),2);"#(I%):PRINT FRE(-1)"NEXT CLOSEEND----------------------------------------------------------------------------Sample program #6. Demonstrates long integer calculation problem. This program will run in QB 4.00 and 4.00a, but it gives incorrect resultsusing BC or BC 6. This problem has been fixed in the BC that comes withQB 4.50.

DEFINT J: DEFLNG T

DIM tum(2), ttm(2), th(2)

ttm(2) = 100000: th(2) = 1000000: j = 2

PRINT th(j) * VAL("9") + ttm(j) * VAL("9")

' Result should be "9900000"

' Substituting th(2) for th(j) (etc). makes it work. So does using' CLNG(VAL("9")). It also works when the array tum(2) isn't there.' Compiling with "/d" may fix the problem in some cases. Substituting' a single precision number seems to work.----------------------------------------------------------------------------Sample program #7. Demonstrates slowdown in STR$ function in QB 4.

defint a-z a!=timer for n=1 to 5000 a$=str$(n) next print "elapsed:" timer-a!----------------------------------------------------------------------------Sample program #9. Demonstrates a problem with IF..THEN..ELSE. Using anycompiler except QB4.00 and QB4.00a, the string "THIS IS AN ERROR" isnever printed. Using these two environments causes the string to printwhenever X<>2.

10 INPUT "TYPE A NUMBER ", X 20 IF X = 2 THEN 50 : PRINT "THIS IS AN ERROR" 30 PRINT "AT LINE 30" 40 GOTO 10 50 PRINT "AT LINE 50" 60 GOTO 10----------------------------------------------------------------------------Sample program #10. Demonstrates a problem when INPUT is used directlyto an array element that is beyond the maximum dimension of the array.When run inside the QB 4 environment, this program will cause a hard crash.This problem does not apply to LINE INPUT.

----------------------------------------------------------------------------Sample program #17. Demonstrates a problem using GOTO inside anIF..THEN..ELSE block. This program will work fine in the QB4.00 and QB4.00aenvironment, but will fail when compiled with BC or BASCOM 6. By "fail",I mean that both PRINT statements are executed. The problem has been fixedin the BC that comes with QB 4.50.

----------------------------------------------------------------------------Sample program #18. Demonstrates a problem using /S in conjunction with/O and communications, where a string literal (in quotes) is used for theCOM parameters. This problem has been fixed in the BC that comes with QB 4.50.

The solution to the above is to assign the COM specifications to a stringbefore doing the OPEN:

A$ = "COM1:1200,O,7,1,CS,DS,CD" OPEN A$ FOR RANDOM AS #1 LEN = 256----------------------------------------------------------------------------Sample program #19. Demonstrates a problem where If a breakpointis set on a CASE line of a SELECT CASE ... END SELECTstatement, the SELECT CASE structure is not executed properly.QB 4.50 tells you that you cannot set a breakpoint on a CASE orEND SELECT statement. Some fix!!!

The reason for this is that, beginning with version 4.00b, when PUTting avariable-length string into a RANDOM file, QB precedes the string with itslength (a two-byte integer). Thus the (apparently) 140-byte T$ above becomes142 bytes in length. Your recommended solution is to declare a file bufferusing the FIELD statement -- that works because FIELDed strings are notvariable-length. Two other options are to declare the record length two byteslonger than you actually need (albeit a bit wasteful, but it works!), or toDIM your string variable to a fixed length, like this:

Thought the above info might help anyone who's been perplexed by the "BadRecord Length" error.----------------------------------------------------------------------------Sample program #22. Demonstrates a problem with CALL:

Note that this program requires TEST.DAT, which is part of the ARC file.It also requires that you use an assembly subroutine to display astring from the array.

The fix is to place A$() in a COMMON SHARED statement and take it outof the parameter list in the CALL and the SUB statements.

stop ' Insert a call to an assembler routine to display A$(1) ' The following 2 lines are included for the benefit of Mach 2 users. ' R%=CSRLIN:C%=POS(0) ' CALL MhScr(A$(1),0%,R%,C%,7%) PRINT PRINT A$(2)END SUB----------------------------------------------------------------------------Sample program #23. Demonstrates a problem with SHARED in QB4.00b. Theproblem did not exist in QB4.00.

If you change the name of db to something else, or you place db and db()in the parameter list, all is well. The problem seems to be that ifyou have a scalar with the same name as an array, and you name it in theSHARED statement, QB thinks that the scalar and the array are one in thesame.

' Load this program into QB, move the cursor to the end of the first' rem $include line and press the Del key. You will get "string space' corrupt" and when you go to run another program, you are hung!

REM $INCLUDE: 'c:\subprogs\done\ssinput.cal'REM $INCLUDE: 'c:\subprogs\done\vinput.cal'----------------------------------------------------------------------------Sample program #25. Demonstrates a problem with long integers usedin user defined types. When you attempt to compile the following programwith BC, you'll get an "Internal error" message from the compiler. Theproblem has been fixed in the BC that is included with QB4.50.

DEFINT A-Z TYPE Bt a AS INTEGER b AS LONG c AS LONG END TYPE DIM Bt(1) AS Bt Bt(y).b = x& Bt(y).c = Bt(y).b

There are several ways of "fixing" the above:

1. Swap the last two lines.2. Change a variable subscript (y) to literal subscript (1)3. Change the order of the variables a,b,c.4. Add a line between the last two lines, like "j=k*3"5. Break the last line up into: temp&=Bt(y).b Bt(y).c=temp&

The problem apparently has to do with optimization of the last twolines of code.----------------------------------------------------------------------------Sample program #26. Demonstrates a problem with FRE(-2) in all versionsof QuickBASIC 2-4.

Note that the error occurs in QB 4.00b and QB 4.50. The second DIM inTEST2.BAS combined with the DIM of an array with a period, causes theproblem.

----------------------------------------------------------------------------Sample program #29. Demonstrates a problem with INT in all versions of QB 4and QBX. (88/12/19).

'This bug only happens using BC4.50/7.0 and QB4.50/QBX. It works'fine in the environment using earlier versions of QB4. 'The INT(numeric expression) statement does not always return the'correct value if the numeric expression is a calculation. The'following example will illustrate:

If you LINK the programs normally, the strings are printed correctlyand the error is handled properly. If you LINK the same modules with/PAC, the data are not read and the error is not handled!

----------------------------------------------------------------------------Sample program #32. Demonstrates a problem with DECLARE.(89/02/10)

In the following program, "MySub1" is not executed. Instead, QBtreats the invocation of the SUB as a label. Note that this happensonly when there are no parameters, and you omit the CALL keyword(requiring that you DECLARE the procedure). In addition, there mustobviously be a colon on the line after the name of the SUB.

Remove the TAB(4); or change REDIM to DIM and it'll work. As it sits it bombsthe computer requiring a reboot. Variables vs literals in the TAB argumentdon't appear to affect it after all. This affects both PRINT and LPRINT.----------------------------------------------------------------------------Sample program #34. Demonstrates a problem using DATA, READ and RUN withBC4.00b and BC6.00b (89/07/29)

' On the second and subsequent executions of this program, BC4.00b gives' a SYNTAX error, while BC6.00b just prints zeros.

READ A% PRINT A% IF INKEY$ <> "" THEN END RUN DATA 1

----------------------------------------------------------------------------Sample program #35. Demonstrates a problem using SWAP and CONST in QB 4.50(89/09/07)

** Warning - this program will crash your system **

Load the following program into QB4.50 and press F5:

const Nul$="" z$="hello" swap z$,Nul$

QB4.50 gives different results, depending on if Nul$ is "" or has a length.

QB4.00b and QBX correctly trap the error of trying to SWAP a constant.----------------------------------------------------------------------------Sample program #36. Demonstrates a problem using temporary strings withDEF FN in all compilers.

When a string is passed as an argument to a DEF FN function, itremains in memory until the next time that function is invoked.In (almost) all other situations where BC/QB has to create atemporary string, it calls the "String Delete" routine to markit as free for the garbage collection. So if you pass, say, a10K string as an argument, you just lost 10K of string space.Ouch, no? This happens only when compiled to disk though, notin the environment. Proof follows.

In the environment, as one would expect, the above programreports CHR$(1) at position 1, CHR$(2) at position 2, etc. for*both* strings. But compiled to an EXE file, INSTR reportsposition 0 for CHR$(1) and CHR$(2) in Literal$

Note: BC7 documents that you cannot use CHR$(1) and CHR$(2) in a string.Actually, you can have those characters in a string, but INSTR and possiblyPRINT won't work correctly.

----------------------------------------------------------------------------Sample program #38. Demonstrates a problem with LINE (filled box) andVIEW that was not fixed until BC7.

----------------------------------------------------------------------------Part 4 - Video adapters compatible with QB 4.50----------------------------------------------------------------------------The following cards are available "in-house" at Microsoft and were testedwith QB4.50

Cards that PASSED:

(Note - if the card is a VGA but not an IBM PS/2 VGA, there will be problems swapping on screen 10.)