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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid identifier error???

Status
Not open for further replies.

TestBacha

Technical User
May 21, 2005
16
GB

Hi guys

I'm working with a script that puts a req file into a server (SFDM server, this is a server that we use to track the serial numbers of the packs in production).
Once that the server takes the REQ file, the server sends back a RSP file.
My problem is that I use the next lines:

fopen 0 Filepc READ ; Open file for read.
"The script Opens the file without problem"
if not ferror 0 ; Make sure there were no errors.

"But at this line and next, it says Invalid identifier error"
while not feof 0 ; Loop to end of file.
fgets 0 RspInfo ; Get line from file.
substr RC RspInfo 12 4 ;Get RC code from RSP File

"Then I process the file without problem"
if strncmp RC "EEEE" 4
delfile Filepc
goto Repeat
endif

"and the same error when it try to close the file"
fclose 0 ; Close the file.
delfile Filepc ; Delete RSP File

Any suggestion? I really appreciate it


Edu Melendez
 
Instead of using ferror, use:

if fopen 0 Filepc READ

I think I've seen some cases in the past where ferror doesn't work as you would expect it to, and I imagine what is happening is the fopen is failing due to the file not existing or something similar.


 

Ok, I'll try this.
Hope it works.

thanks

Edu Melendez
 

Knob???

I was trying to look for the specific error on my script. I got this script (called PASSFAIL.wax) already working. but it works as a single script. I mean now i'm using it as a procedure inside a INC file.

I use some termmsg to see the lines that the script was teaking and they're Ok. So the problem is that once that I get the line, the script close the file, the the file is deleted. but the program returns to the while loop.

As a part of a procedure, may i use the RETURN command to terminate the proc and get back to the main procedure?? I haven't try it yet cause I crashed my Laptop accidentally.

Rgds
EM

Edu Melendez
 

Ok, But is just another procedure, inside an Include file.
So I think that is different, isn't it?

the help file says (I haven't my PC at this moment, but I remembered it)that the return command will quit the proc and go back to the statement that called the proc.

But i'm not sure. So let me try with the Exit command then

Thanks!!

Edu Melendez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top