Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Saifuddin Hussain
  Where is Saifuddin Hussain?
 Dubai
 United Arab Emirates
 Saifuddin Hussain
Subject: RE: Compilation Error
Thread ID: 160221 Message ID: 160224 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Distribution and InstallShield
Date: Wednesday, February 13, 2008 10:39:49 AM         
   



> After compiling the application, when I run exe file I shows an error
> "Invalid subcript reference."
>
> Cancel, Ignore, Help
>
> Please let me know what is this?
>
> Saif

Saif,

The invalid subscript reference has to do with an array. If, for example you have an array with 5 elements and you attempt to read the 6th element, you will get this error:
LOCAL laArray[5,1], lnI

FOR lnI = 1 TO 5
   laArray[lnI,1] = "Element "+ TRANSFORM(lnI)
ENDFOR

FOR lnI = 1 TO 6
   WAIT WINDOW "Loop " + TRANSFORM(lnI)
   ? laArray[lnI,1] && Will give you the error on the sixth loop
ENDFOR


You should also get this error if you run your app (from your Main.Prg) in the development environment. In your project, click on your Main.Prg and then click the "Run" button. When you get to the point where you get that error in the EXE, you should get it in the development environment but this time, you should be able to suspend. When you get the error, suspend and then go to the debugger. The debugger will give you the exact line of code that your program is failing on.

Ken
You shall know the truth - and the truth shall set you free. (John 8:33)

ENTIRE THREAD

Compilation Error Posted by Saifuddin Hussain @ 2/13/2008 10:27:10 AM
RE: Compilation Error Posted by Ken Murphy @ 2/13/2008 10:39:49 AM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/13/2008 12:02:58 PM
RE: Compilation Error Posted by Ken Murphy @ 2/13/2008 12:28:37 PM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/13/2008 1:45:55 PM
RE: Compilation Error Posted by Christian Tabligan @ 2/13/2008 9:00:34 PM
RE: Compilation Error Posted by Bernard Bout @ 2/16/2008 4:26:34 AM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/16/2008 5:17:24 PM
RE: Compilation Error Posted by Bernard Bout @ 2/17/2008 12:44:27 AM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/18/2008 1:32:14 PM
RE: Compilation Error Posted by Ken Murphy @ 2/18/2008 2:05:59 PM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/19/2008 2:34:16 PM
RE: Compilation Error Posted by Ken Murphy @ 2/19/2008 3:48:11 PM
RE: Compilation Error Posted by Saifuddin Hussain @ 2/19/2008 4:45:24 PM