[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive]
Processing files using file mask
Dim file_name, string
Dim found, boolean
Dim attr, number
Dim read_only, boolean
Dim hidden, boolean
Dim system, boolean
Dim directory, boolean
Dim archived, boolean
Dim message, string
Dim new_line, string
// Start file search
FileFindFirst( "*.txt", file_name, found )
LoopWhile( found, ENDLOOP )
// File found, do something with the file here
// ...
// For example we can get file attributes then display them
FileGetAttr( file_name, attr )
BitwiseGetBit( attr, 1, read_only )
BitwiseGetBit( attr, 2, hidden )
BitwiseGetBit( attr, 3, system )
BitwiseGetBit( attr, 5, directory )
BitwiseGetBit( attr, 6, archived )
// Show nice message
Char( 13, new_line )
Concat( "File: ", file_name, message )
Concat( message, new_line, message )
Concat( message, " Read Only: ", message )
Concat( message, read_only, message )
Concat( message, new_line, message )
Concat( message, " Hidden: ", message )
Concat( message, hidden, message )
Concat( message, new_line, message )
Concat( message, " System: ", message )
Concat( message, system, message )
Concat( message, new_line, message )
Concat( message, " Directory: ", message )
Concat( message, directory, message )
Concat( message, new_line, message )
Concat( message, " Archived: ", message )
Concat( message, archived, message )
MessageBox( message )
// Find next file
FileFindNext( file_name, found )
ENDLOOP: