Matching file name with literal string

Chemi

New Member
Hello all.

I'm trying to compare a file name with a literal string, but i obtain error 223 (Incompatible data types in expression or assignment).

This is my code:

Code:
DEFINE VARIABLE cRuta AS CHARACTER LABEL "Introduce ruta completa donde se encuentran los ficheros ERP" FORMAT "X(100)" NO-UNDO.
DEFINE VARIABLE cFichero AS CHARACTER FORMAT "X(100)" NO-UNDO.
DEFINE VARIABLE cRutaFichero AS CHARACTER FORMAT "X(100)" NO-UNDO.
DEFINE STREAM sFichero.
 
SET cRuta WITH SIZE 100 BY 5.
 
INPUT STREAM sFichero FROM OS-DIR(cRuta) NO-ATTR-LIST.
 
IMPORT STREAM sFichero cFichero cRutaFichero.
 
IF cFichero MATCHES ("Efectivo_*txt") THEN
    (...)
END.

I tried using STRING(sFichero) and STRING(cRuta) but it does not resolve the problem.

Could anyone help me?

Thanks in advance.

Regards.
- José Miguel Giménez García.
 
Except the absence of a repeat block I don't see anything wrong with this code.
I think the error comes from some other part of the program you are running. (which isn't posted here).

Casper.
 
Oh dear! you are right. The error was in the very next line. It seems AVM takes the line after THEN as the same line as IF line.

Code:
/* line 1 */ IF expression THEN
/* line 2 */ run something.

Line 2 is indeed line 1 to AVM.

Thank you Casper.

Regards.
- José Miguel Giménez.
 
Back
Top