File_Records(...,Read_File_Name,...)
Description
This function reads record file name. Longest file name could be 100 bytes.
Syntax
File_Records(file_number, Read_File_Name, offset, length, string[]);
Parameters
Variable | Input |
|---|---|
| FILE_1 - Read name of record file 1. FILE_2 - Read name of record file 2. FILE_3 - Read name of record file 3. |
| Element of record to read from. |
| Number of record elements to read. |
| Destination array where record information will be written. |
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Success |
Function call example
example of reading name of created file
#define FILE_ARRAY_LENGTH 25
new file_array{FILE_ARRAY_LENGTH}= "information to store: 234";
new file_name[FILE_ARRAY_LENGTH];
main()
{
File_Records(FILE_1, Create_File, "File_test.bin"); // creates FILE_1 record with name `File_test.bin`
File_Records(FILE_1, Write_File, file_array, FILE_ARRAY_LENGTH); // writes array information to FILE_1 record
File_Records(FILE_1, Close_File); // closes FILE_1 record
File_Records(FILE_1, Read_File_Name, 0, FILE_ARRAY_LENGTH, file_name); // writes file name to `file_name` = "File_test.bin"
for(;;)
{
Delay(1000);
}
}