Page 1 of 1

Routine Error

Posted: Thu Oct 20, 2005 8:01 am
by hemant
Hi,

I have created a transform type routine to append user supplied information to an existing text file. Since this routine needs to be called several times during the sequencer, no data should be overwritten in any call.
So, i forward the read pointer by having repeated READSEQ calls until it reaches the EOF. But i'm encountering a abrupt abort whenever this routine is called in the sequencer. 'InputArg' (is a filename) and 'Msg' are the user supplied arguments. Pls find enclosed the code for the routine.

ValidOpen = @FALSE
filename = InputArg
OPENSEQ filename TO FILE Then
ValidOpen = @TRUE
End Else
CREATE FILE Then ValidOpen = @TRUE
End

NewTxt = Msg
FileEnd = 0

Loop
READSEQ A FROM filename Then
End Else
FileEnd=1
End
Until FileEnd
Repeat

WRITESEQ NewTxt TO FILE else
End
WEOFSEQ FILE
CLOSESEQ FILE
Ans=1

Posted: Thu Oct 20, 2005 9:21 am
by kcbland
How about putting some DSLogInfo calls into the "Else" conditions to see why some of those (just a guess) are failing. If the else condition is taken and you don't act accordinly and the logic continues, bad things can happen.

Posted: Thu Oct 20, 2005 3:20 pm
by roy
Hi,
Use SEEK to get to the EOF.
SEEK is in the basic manual.

IHTH,