SourcePoint AMD Help

Table of Contents

fprintf

Write formatted output to a file.

Syntax

fprintf(file_handle, format [, expr [,...] ] )

Where:

file_handle

is a file handle returned from a previous fopen command

format

is a string constant or nstring variable which determines the format of the display

expr

is an expression that is evaluated and displayed

Discussion

Use the fprintf function to write formatted output to a file. ย The fprintf function is similar to the C-language fprintf routine. ย (See printf for more information.)

Example

Command input:

define ord4 file1
file1 = fopen("test.dat", "w")
define nstring myStr = "this is a test"
define ord4 myNum = 1234
define char myChar = 'A'
fprintf(file1, "%s %d %c", myStr, myNum, myChar)
fclose(file1)

Related Topics: