File_Open(pFileName), Byte
pFileName: The name of the file to open for reading (maximum length 12 characters, including dot and extension).
|
Value |
Meaning |
|
cErrOK |
Success. |
|
cErrNotFound |
File not found. |
|
cErrInUse |
File number is already in use. |
|
cErrRWError |
Read/write error. |
This procedure opens an existing file for reading only. The maximum name length is 12 characters, including the file extension.
File_Open("MyFile.txt")
|
TftSetUp(0, 0) 'Set screen TftResetScreen(BLACK) 'Reset screen TftSetSndFont(0,0) 'Set Font0 While File_Init() <> cErrOK : Wend 'Initialize SD Card TftPrintSndString("Sd Initialization OK",1,0,0,1,GREEN,BLACK,0) 'Confirm Initialize SD Card While File_Open("Open.txt") <> cErrOK : Wend 'Open file Open.txt to edit data TftPrintSndString("Open Open.txt OK",1,0,2,1,GREEN,BLACK,0) 'Confirm Open.txt is open bCounter = 0 'Print position counter Do TftPrintSndChar(File_ReadByte(),1,bCounter,3,1,GREEN,BLACK,0) 'Print data as text If File_EOF() = 1 Then Break 'Loop till end of file Inc bCounter Loop File_Close() 'close file TftPrintSndString("Close Open.txt OK",1,0,4,1,GREEN,BLACK,0) 'Confirm close file |
|
|
Created with the Personal Edition of HelpNDoc: Revolutionize your documentation process with HelpNDoc's online capabilities