Routine Error
Posted: Thu Oct 20, 2005 8:01 am
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
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