Microsoft KB Archive/31822

= Structured Programming in QuickBasic - Subprograms; SHARED =

Article ID: 31822

Article Last Modified on 11/21/2006



This article was previously published under Q31822



SUMMARY
Microsoft QuickBasic for MS-DOS provides structured programming features that exceed BasicA's FOR/NEXT, WHILE/WEND, and GOSUB statements. True subprograms with scalar and array parameters are easy to use in QuickBasic. All variables in subprograms are local unless they are declared as shared-global variables in the current module, as shown in the following example: bubbles = 10 CALL MySort (howbig, Array)    'sort Array END

SUB MySort (limit, Sieve) STATIC   'Sieve is 1-dim SHARED bubbles              'global variable ... ' MySort subprogram body END SUB Note that the SHARED statement does not share variables across separately-compiled modules, it only shares with the main program level (&quot;module level&quot;) of the current module. To share variables across separately-compiled modules, you must use the COMMON SHARED statement.

Additional query words: QuickBas BasicCom

Keywords: KB31822

-

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

© Microsoft Corporation. All rights reserved.