Programming Guide



sm_fio_f2a

Writes a file's contents to an array

int sm_fio_f2a(char *file_name, char *array_name);

file_name
The name of the file to read.

array_name
The name of a Panther widget.

Returns

Description

sm_fio_f2a writes the contents of a file to an array. All previous text in the array is overwritten. If the array belongs to a synchronized scrolling group, the data of other members in the group is unaffected.

Panther attempts to write each line in the file to a single occurrence. If any line is too long for its target occurrence, Panther breaks the line and writes the overflow text to the next occurrence. If the array contains too few occurrences to read the entire file, sm_fio_f2a discards the excess text.

Example

proc file2array()
vars fileName, retErr

/* get file name sent from previous dialog */
receive DATA fileName

/* put file's contents into array*/
retErr = sm_fio_f2a(fileName, "comments")

if retErr != 0
{
call io_errproc(retErr)
}
return

See Also

sm_fio_a2f