DMS500Tech
Technical User
I am at point where I don't know how to proceed. The following code handles the one exception perfectly. The code will pick out "ALREADY EXIST" on the fly and pass by and it and adds the feature at a rate of less than 2 seconds an instance. The problem comes when trying to add a second exception. I also need to look for "LEN Entered is not assighned to a DN". I am having trouble figuring out how to assign what is flying by the command line to a varible or get a second "if waitfor" to work. If a varible can be assigned then a "switch" "case" could be done or if there is another way to accomplish this I am open to suggestions. An IF and ELSEIF has already been tried but it does not work.
CODE:
if sdlginput "File Name" "Enter path and file name:" FName
if isfile FName ; Make sure file exists.
if fopen 0 FName READ ; Open file for read.
while not feof 0 ; Loop to end of file.
fgets 0 LineInfo ; Get line from file.
transmit "ADO $ ^M "
transmit lineinfo ; Send line to port
transmit "LCDR $ Y^M"
if waitfor "LCDR : ALREADY EXISTS" 1
pause 1
transmit "N^M"
pause 1
endif
transmit "^M"
; pause 1
endwhile
fclose 0 ; Close the file.
endif
else
errormsg "File doesn't exist."
endif
endif
CODE:
if sdlginput "File Name" "Enter path and file name:" FName
if isfile FName ; Make sure file exists.
if fopen 0 FName READ ; Open file for read.
while not feof 0 ; Loop to end of file.
fgets 0 LineInfo ; Get line from file.
transmit "ADO $ ^M "
transmit lineinfo ; Send line to port
transmit "LCDR $ Y^M"
if waitfor "LCDR : ALREADY EXISTS" 1
pause 1
transmit "N^M"
pause 1
endif
transmit "^M"
; pause 1
endwhile
fclose 0 ; Close the file.
endif
else
errormsg "File doesn't exist."
endif
endif