Writes a line of text to an open fileint sm_fio_puts(char *string, int file_stream);
Character string to be output.
- A handle to the file to write to, obtained by sm_fio_open.
sm_fio_putswrites the contents of
stringto the specified open file and appends a newline
\ncharacter. Be sure to call sm_fio_close on
file_streamafter you finish writing the data; the actual write operation is not complete until the handle to this file stream is released.
vars str, occurNo, err, fileStream, maxOccurs
/* get array size */
maxOccurs = @widget("comments")->max_occurrences
/*get file stream handle sent from previous dialog */
receive BUNDLE f_handle DATA fileStream
/* loop through array occurrences */
for occurNo = 1 && err = 0 \
while (err == 0 && occurNo <= maxOccurs)
/* get string in current occurrence */
str = comments[occurNo]
/* put string into next line of file stream */
err = sm_fio_puts(str, fileStream)
/* close file stream when done */