Microsoft KB Archive/41151

= Function KEY Strings Retained After CHAIN in QuickBasic 4.x =

Article ID: 41151

Article Last Modified on 11/21/2006



This article was previously published under Q41151



SUMMARY
If you define strings to be returned by function keys F1 through F10 (using KEY n,&quot; &quot;), and then CHAIN to another program, these function key strings are retained unless the programs are compiled as stand alone. This behavior applies to Microsoft QuickBasic Versions 4.00, 4.00b, and 4.50, Microsoft Basic Compiler Versions 6.00 and 6.00b, and Microsoft Basic PDS Version 7.00.

In QuickBasic Versions 3.00 and earlier, the function key strings are not retained after CHAINing.



MORE INFORMATION
When CHAINing between programs, unnamed COMMON blocks and open files are preserved from the CHAINing program to the CHAINed-to program only if the programs are compiled without the /O (stand-alone EXE) option.

If the two programs below are compiled with QuickBasic Version 3.00 using no options, the KEY list is destroyed after the CHAIN. However, if the same programs are compiled using no /O option under a later version of QuickBasic or Microsoft Basic Compiler Version 6.00 or 6.00b, or Basic PDS 7.00, the KEY list is retained in the second program.

The following is a code example: '** KEY1.BAS FOR t=1 TO 10 KEY t,&quot;*****&quot; NEXT t KEY LIST INPUT &quot;Press any function key F1 - F10 and hit RETURN&quot;,X$ CHAIN &quot;key2&quot;

'** KEY2.BAS CLEAR KEY LIST INPUT &quot;Press any function key F1 - F10 and hit RETURN&quot;,X$ PRINT &quot;End of programs.&quot; END

Additional query words: QuickBas BasicCom

Keywords: KB41151

-

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

© Microsoft Corporation. All rights reserved.