PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 24 → Read Txt AscII - LE_ASCII
Read Txt AscII - LE_ASCII
Débuté par adrianoboller, 18 nov. 2014 14:29 - Aucune réponse
Membre enregistré
2 958 messages
Popularité : +89 (91 votes)
Posté le 18 novembre 2014 - 14:29
Procedure LE_ASCII(LOCAL ArquivoTxt)

//Le arquivo texto

// Declare the variables
PathFile is string = ArquivoTxt
IdFile, ResCloseFile, FileID, NumeroLinha is int
Line is string

// Open the file
FileID = fOpen(PathFile,foReadWrite)
IF IdFile = -1 THEN
Error(ErrorInfo(errMessage))
ELSE

//Converte de Unicode para Ansi
Line = UnicodeToAnsi(fReadLine(FileID))

//Linha 1
NumeroLinha = 1
//Info("Linha:" + NumeroLinha, Line)

WHILE Line <> EOT AND Line <> ""

//Proxima linha
NumeroLinha += 1
Line = fReadLine(FileID)
//Info("Linha:" + NumeroLinha, Line)

END
IF Line = "" THEN Error(ErrorInfo(errMessage))
IF Line = EOT THEN Info("Final do Arquivo.")
ResCloseFile = fClose(IdFile)
IF ResCloseFile = -1 THEN
//Error(ErrorInfo(errMessage))
END

END