Microsoft KB Archive/42466

= &quot;RETURN Without GOSUB&quot;; Btrieve BTVRFAR Fails with Basic =

Article ID: 42466

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0

-



This article was previously published under Q42466



SUMMARY
Btrieve now has a procedure named BTRVFAR, which is intended to allow Btrieve to access variables outside of the near heap. This procedure is not compatible with Basic and may cause the error message &quot;RETURN without GOSUB&quot; to be displayed, even though no such error exists. In some cases, the program may work correctly in the trace mode or even in the normal mode after the program has been run once with the trace function on.

This information applies to QuickBasic Versions 4.00, 4.00b, and 4.50, Microsoft Basic Compiler Version 6.00 and 6.00b for MS-DOS and MS OS/2, and Microsoft Basic PDS Version 7.00 for MS-DOS and OS/2. Please note that Basic PDS 7.00 for MS-DOS and has its own ISAM file system, making Btrieve, a third-party ISAM support product, unnecessary.



MORE INFORMATION
This compatibility problem occurs whether executed from within the QB.EXE environment of QuickBasic, the QBX.EXE environment of the Basic PDS 7.00, or from an executable program compiled with BC.EXE.

The solution to the problem is to use the older Btrieve procedure named BTRV. Shown below is the only change necessary for most programs using BTRVFAR to convert them to use BTRV.

Code Example
' This code is incomplete; only the highlights are shown OPEN &quot;NULL&quot; FOR RANDOM AS #1 LEN = 40 FIELD #1 40 AS A$ OP%=0 BLK$=SPACE$(128) BLEN%= 40 KBUF$ = &quot;FileName&quot; KNUM% = 0

FCB% = SADD(A$) - 188

'Use: CALL BTRV( OP%, STAT%, BLK$, FCB%, BLEN%, KBUF$, KNUM%) 'Instead of: ' CALL BTRVFAR(OP%,STAT%,BLK$,SADD(A$),VARSEG(A$),BLEN%,KBUF$,KNUM%);

Additional query words: QuickBas BasicCom

Keywords: KB42466

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.