Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalis subscript reference
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Invalis subscript reference
Miscellaneous
Thread ID:
00684692
Message ID:
00684692
Views:
51
Hi,
I have a program that has been running perfectly for the last one month. This program extracts data from an HP database to a Foxpro database. It is automated to run as a night job.

But yesterday, the program gave the error 'Invalid subscript reference'. The log files that have been created, gives us a vague idea of where exactly the program crashed. These are the lines of code in which this error had to happen.

******POINT A

WAIT clear
@ 0,0 clear
DO while .t.
m.x =GETAFILE(HPfileName , "c:\fileA")
IF m.x=.f.
m.xm=MESSAGEBOX("Did not allow Extract process to complete .. "+;
chr(13)+"You may press RETRY or IGNORE to continue."+;
chr(13)+"Or press Any Key and notify IDP." , 16+2 , "HP File Transfer Error" )
IF m.xm=4
LOOP
ENDIF
ENDIF
EXIT
ENDDO

GETAFILE is a procedure that downloads the file from the HP system and it has more HP relevant code. I am not certain if this procedure was ever called. But if it was, it was never completed. Also all code upto Point A was definitely executed successfully.

GETAFILE , has a statement like this, to log error messages to the Log File.

ON ERROR DO WRITELOG("ERROR NUMBER: " + LTRIM(STR(ERROR()) + " ") + CHR(13) + ;
"ERROR MESSAGE: " + LTRIM(MESSAGE()) + CHR(13) + ;
"PROGRAM NAME: " + LTRIM(PROGRAM()))

This is how WRITELOG looks:

PARAMETERS LOGMSG

IF PARAMETERS() < 1
RETURN
ENDIF

IF LOGCREATED && boolean variable indicating whether the logfile exists
LOCAL LCLNO
LCLNO=FOPEN(LOGFILE,2) && logfile="c:\log.txt"
IF LCLNO <> -1
=FSEEK(LCLNO,0,2)
=FPUTS(LCLNO,LOGMSG)
=FPUTS(LCLNO,"")
ENDIF
=FCLOSE(LCLNO)
ENDIF

RETURN



Does any of this code seem likely candidates for this kind of error?

Thank you.

Ria
Next
Reply
Map
View

Click here to load this message in the networking platform