File_Records(...,Read_File,...)

File_Records(...,Read_File,...)

Description

This function reads record information

Syntax

File_Records(file_number, Read_File, offset, length, string[]);

Parameters

Variable

Input

Variable

Input

file_number

FILE_1 - Read record file 1.

FILE_2 - Read record file 2.

FILE_3 - Read record file 3.

offset

Element of record to read from.

length

Number of record elements to read.

string[]

Destination array where record information will be written.

Returns

Return value

Return explanation

SCRIPT_OPERATION_SUCCESS

Success

SCRIPT_OPERATION_FAILED

Failed

Function call example

example of reading record
#define FILE_ARRAY_LENGTH 25 new file_array{FILE_ARRAY_LENGTH}= "information to store: 234"; new file_content[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, 0, FILE_ARRAY_LENGTH, file_content); // reads stored information in record and store to `file_content` for(;;) { Delay(1000); } }

Notes and Warnings

Active record must be closed before trying to create a new record.

Used in Examples

File Records example