Trying to write a conversion program from oem to ansi or vice versa , fivewin error description gives :
Argument error : conditional , Main(17)
The problem is that the error only occurs on line 19 . Why ?
Can it be confirmed ?
Frank
- Code: Select all Expand view
# include "fivewin.ch"
FUNCTION MAIN(DirBron,DirBest,lMode)
LOCAL aFiles , el , DbfFile , elem , aStruct , h , i , Blck
IF pCount() > 0
IF (DirBron IN "NILnil")
DirBron := nil
END
END
IF pCount() > 1
IF (DirBest IN "NILnil")
DirBest := nil
END
END
IF pCount() > 2
lMode := (lMode=="T") // .T. : ANSI->OEM
END
DEFAULT DirBron := "\HENDOS\DATA"
DEFAULT DirBest := "DATA"
DEFAULT lMode := "F" // .F. : OEM->ANSI THIS CAUSES A ERROR ON NEXT LINE (20) , ERROR REPORT SHOWS 17 !!!!!!!
Blck := IIF(lMode , {|j|AnsiToOem(j)} , {|j|OemToAnsi(j)})
# ifndef TEST
aFiles := Directory(DirBron+"\*.DBF")
# else
aFiles := Directory(DirBron+"\GEMEENTE.DBF")
# endif
FOR EACH el IN aFiles
DbfFile := el[1]
COPY FILE (DirBron+"\"+DbfFile) TO (DirBest+"\"+DbfFile)
USE (DirBest+"\"+DbfFile)
aStruct := DbStruct()
DO WHIL ! EOF()
FOR EACH elem IN aStruct
i := Hb_EnumIndex()
IF Elem[2] == "C" .AND. Elem[3] > 3 .AND. (h := EVAL(Blck,Fieldget(i))) <> Fieldget(i)
// FIELDLEN < 4 : Idnumbering , NO CONVERSION !
Fieldput(i,h)
END
NEXT
SKIP
END
NEXT
CLOS ALL
RETURN