Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error 5 : invalid identifier 1

Status
Not open for further replies.

mntlfngrs

Technical User
Apr 13, 2002
36
US
We just upgraded (finaly) from 2.1 to 4.8. When I first installed 4.8 I recompiled our scripts and they seemed to work fine. Today though I am getting
"error 5: invalid identifier" when I compile and run.
The source line text from debug is:

fread 51 storenumber[anyx] 4
hit continue and...
fread 51 dataprobe[anyx] 1
hit continue and...
fread 51 inc[anyx] 1
hit continue and...
fread 51 csu[anyx] 1
hit continue and...
fread 51 framerelay[anyx] 12
hit continue and...
fread 51 backupint[anyx] 12

There are no other occurances of fread in the script so I think that this is where the problem lies. Heres the whole snippet from the fread and the corresponding fwrite.

fopen 51 filenew READWRITE
for anyx = 0 upto 999
fread 51 storenumber[anyx] 4
if strcmp storenumber[anyx] "endo"
storenumber[anyx] = ""
lastx = anyx
exitfor
endif
fread 51 dataprobe[anyx] 1
fread 51 inc[anyx] 1
fread 51 csu[anyx] 1
fread 51 framerelay[anyx] 12
fread 51 backupint[anyx] 12
endfor

copyfile filenew fileold
fopen 50 filenew CREATE
for anyx = 0 upto (lastx - 1)
fwrite 50 storenumber[anyx] 4
fwrite 50 dataprobe[anyx] 1
fwrite 50 inc[anyx] 1
fwrite 50 csu[anyx] 1
fwrite 50 framerelay[anyx] 12
fwrite 50 backupint[anyx] 12
endfor
fwrite 50 " endo" 5
fclose 50

This script worked fine in 2.1 and I swear it worked when I first installed 4.8 (after recompiling) so where is this error coming from? I can compile it in 2.1 again and it works fine.
 
P.S. thanks for your help!

Adam "Be all and you'll be to end all.
Life can be a real ball.
State of mind!"
 
The first thing I would try is checking the result code of the fopen command to make sure the file is being opened successfully. If you look at the discussion of the fopen command in the ASPECT help file, the example script shows how to do this. My hunch is that the fopen is failing for some reason and that is why the error 5 is occurring.
 
From what I have seen in the Past, a RunTime Error Code 5 occurs when the Script cannot locate the File to Fopen. Scripts will compile; but Fail when Ran.
 
Thanks guys, your right the file is failing to open. This was not a problem with procomm 2.1. The file is in the correct location but it is on a share drive. Does the fopen command act differently in 4.8 as opposed to 2.1? Specificaly does it fail more quikly than in 2.1? Can I force it to allow more time to open the file? The script runs file if I put all files on the local drive but different people run it from different PCs so the share drive is needed. "Be all and you'll be to end all.
Life can be a real ball.
State of mind!"
 
Solved it by mapping a drive to the folder where the data file is kept. Now I just have to get everyone to map drive Z: to the correct folder. "Be all and you'll be to end all.
Life can be a real ball.
State of mind!"
 
Were you trying to access the file via a UNC path? I was able to get the fopen command to open a file on the network via a UNC path. However, I got the error 5 when I tried to used the fgets command to read from the file. I am wondering if the backslashes in the UNC path are being interpreted by ASPECT in some way, but have not been able to find anything in the help file that indicates this.

I don't have my Procomm 2.1 manual handy, but I would think the commands should have roughly the same functionality between the two versions. However, version 2.1 was a 16-bit version not intended for 32-bit Windows machines, while 4.8 was designed for 32-bit windows, so that could cause some operational differences.
 
Yes, I was using UNC and it worked fine in 2.1 "Be all and you'll be to end all.
Life can be a real ball.
State of mind!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top