Microsoft KB Archive/69160

= &quot;Subscript Out of Range,&quot; Graphics GET with LONG Integer =

Article ID: 69160

Article Last Modified on 11/21/2006



This article was previously published under Q69160



SUMMARY
If the graphics GET statement is used in a subprogram with a LONG integer array and if the starting index of the array is not the first element, a &quot;Subscript out of Range&quot; error will be generated if the program is compiled with BC /D. If the program is compiled without the /D option, BC.EXE will give an &quot;Illegal function call&quot; error.

This problem does not occur in the QBX.EXE or QB.EXE environment.

Microsoft has confirmed this to be a problem with Microsoft QuickBasic versions 4.00, 4.00b, and 4.50 for MS-DOS; Microsoft Basic compiler versions 6.00 and 6.00b for MS-DOS and MS OS/2; and Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and MS OS/2. We are researching this problem and will post new information here as it becomes available.



MORE INFORMATION
The program below demonstrates the problem. Compile and link as follows: BC /D SAMPLE; LINK SAMPLE; When the program is run, it will draw a circle and then print &quot;Subscript out of Range in line 7 of module SAMPLE.&quot;

To work around this problem, either place the array in COMMON SHARED or use a local array instead of one that is passed as a parameter. It is also possible to uses SINGLE precision numbers instead of LONG integers.

Code Sample: SAMPLE.BAS
DECLARE S 1 DIM array(1000) AS LONG 2 SCREEN 1 3 CIRCLE (50, 50), 50 4 CALL test(array) 5 CLS 6 PUT (100, 100), array(4) SUB test (array AS LONG) 7 GET (50, 50)-(100, 100), array(4) END SUB

Additional query words: QuickBas BasicCom

Keywords: KB69160

-

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

© Microsoft Corporation. All rights reserved.