Opcode Database

Latest Forum Activity

GTAG - Modding - Opcode Database - 0AE6

Opcode Database

0AE6

DescriptionOpens search for a file or directory on a mask, returns the name of the first found file/directory and sets the result of logical operation TRUE, if the file/directory was (a) found (a), or FALSE otherwise.

In the example, will be found the first file in the folder with the CLEO extension cs. Opcode returns the handle to the search, which can be used opcodes 0AE7 to find the next file on the same mask. When the search should use opcodes 0AE7, to close the search.

The mask can contain wildcards:
'*' - replaces an indefinite amount of any related characters.

'?' - 1 replaces any character. The mask should not be a NULL or empty string, and end with the backslash ''.

If the mask is the shortest path search, the search will be conducted on the current working directory (see 0A99). Full path to the file can not exceed the length of MAX_PATH (260 characters).

To determine the type of what was found (file / directory) should use one of the opcodes: 0AE4, 0AAB.
Parameters (v2)1) File path (Long String) (ANY)
2) (Returned) Handle (Integer) (INT)
3) (Returned) Long string ("string") (ANY)
Gamessa
CategoryCLEO 4
San Andreas
sascm.ini0AE6=3, find_first_file %1d% store_search_to %2d% store_filename_to %3d%
Example0AE6: find_first_file "CLEO\*.cs" store_search_to 0@ store_filename_to 1@v
Command NameFIND_FIRST_FILE

<< 0AE5

0AE7 >>