I am writing a routine which should read lines in a sequential file and compare the line number with the input argument which is also a number(passed as a argument).If the both the line no and the input value(passed as a argument) matched it should retrive the record to the Ans.
I am very new to writing routines and i tried to write the following code.But could not succeed on it.
$INCLUDE DSINCLUDE JOBCONTROL.H
PathName = Trim(FilePath):"/":Trim(FileName)
InitialCount = 0
Counter = 0
OpenSeq PathName To FileVar Else
Call DSLogWarn("Cannot open ":PathName, ExtractingString)
End
Loop
ReadSeq FileLine From FileVar
On Error
Call DSLogWarn("Cannot read ":PathName:" status=":Status(),"ExtractingString")
End
Then
Counter += 1
End
If Counter = Arg1
Then Ans = FileLine
End
End
Repeat
CloseSeq FileVar
Ans = FileLine
========================================================================================================================
It is throwing me an error as----
Compiling: Source = 'DSU_BP/DSU.ExtractingString', Object = 'DSU_BP.O/DSU.ExtractingString'
********************************************
0039 End
^
End of Line unexpected, Was expecting: END, "REPEAT", "UNTIL", "WHILE"
0044 Repeat
^
WARNING: Text found after final END statement
1 Errors detected, No Object Code Produced.
===============================================================================================================
What might be the possible reason
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)