File_ListReset()
File or Folder List Counter
File_ListReset() is a command used to reset the internal counter or pointer for the file or directory listing process. This is typically used before you start listing or accessing files and directories on the SD card or storage device.
Example:
File_ListReset()
Why Use?
• Initialization: Ensures that the list of files or directories starts from the beginning.
• Avoid Overlap: Prevents errors or inconsistencies when you attempt to list files or directories more than once without resetting the internal counter.
TftSetUp(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 bCounter = 27 'Vertical print counter File_ListReset() 'Reset file/folder counter Do Clear sString sString = File_ListDir() 'Loop through folder names If sString = 0 Then Break 'Break if end of list TftPrintSndString(sString,1,0,bCounter,1,GREEN,BLACK,0) 'Print folder name Dec bCounter 'Move to next print line Loop bCounter = 27 'Vertical print counter File_ListReset() 'Reset file/folder counter Do 'Loop through file names Clear sString sString = File_ListFile() If sString = 0 Then Break 'Break if end of list TftPrintSndString(sString,1,20,bCounter,1,WHITE,BLACK,0) 'Print folder name Dec bCounter 'Move to next print line Loop |
|
Created with the Personal Edition of HelpNDoc: Elevate Your Documentation Process with HelpNDoc's Advanced Features