I'm having problems creating one routine and I can't realize where the hell the error is. I presume it's related with some order or basic sintaxs stuff. I wonder whether some of you can evangelize me and let me find the answer.
This are the parameters for the routine:
Kstar
PathArchivoOrigen
CantidadCampos
PathArchivoDestino
This is the error message I'm getting:
REPEAT" unexpected, Was expecting: Array Name, Variable name,
New variable name, ';', Statement label, "ABORT", "ABORTE", "ABORTM",
"BEGIN", "BREAK", "CALL", "CHAIN", "CLEAR", "CLEARCOM", and so on....
This is the routine code:
PathOrigen = PathArchivoOrigen
RegistroDestino = ''
NoCumple = 0
OpenSeq PathOrigen To VariableFileOrigen Then
Loop
While ReadSeq RecordString From VariableFileOrigen
If Field(RecordString, ",", 6) = Kstar then
ValOption = Field(RecordString, ",", 5)
ValFrom = Field(RecordString, ",", 6)
ValTo = Field(RecordString, ",", 7)
Exit
End Else
ValOption = 'NN'
End
Repeat
CloseSeq VariableFileOrigen
OpenSeq PathOrigen To VariableFileOrigen then
PathDestino = PathArchivoDestino :ValOption
Loop
While ReadSeq RecordString From VariableFileOrigen
ValToActual = Field(RecordString, ",", 6)
ValFromActual = Field(RecordString, ",",7)
For CampoActual = 1 to CantidadCampos
RegistroDestino = RegistroDestino :",":Field(RecordString, ",", CampoActual)
Next CampoActual
OpenSeq PathDestino To VariableFileDestino Then
Begin Case
Case ValOption = 'EQ'
If ValFromActual = ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'NE'
If ValFromActual <> ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'BT'
If ValFromActual > ValFrom AND ValToActual < ValTo
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'LE'
If ValFromActual <= ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'GT'
If ValFromActual > ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'GE'
If ValFromActual >= ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
Case ValOption = 'LT'
If ValFromActual < ValFrom
then WriteSeq RegistroDestino To VariableFileDestino
else NoCumple = NoCumple + 1
End Case
Repeat
CloseSeq VariableFileOrigen
CloseSeq VariableFileDestino
Ans = NoCumple
-*-*-*-**-*
If anyone can solve this, he is earning my eternal respect!
![Smile :-)](./images/smilies/icon_smile.gif)
Thanks a lot!
Alejandro Tavella