Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: misc.fgets - Function Up: misc - Tool Previous: misc.fclose - Function


misc.fprintf - Function



Package utility
Module misc
Tool misc


C-style formatted output


Synopsis
fprintf(fileid, format, ...)


Description
This and the following routines provide input and output formatting capabilities similar to those provided in C libraries. See the UNIX man page on e.g. fprintf for more information. Differences from the C routines are described.

The ellipsis ... denotes that any number of arguments may be provided.



Arguments

fileid   File id
    Allowed: file id as returned by fopen
format   c-style format description
    Allowed: String
...   Additional arguments
    Allowed: Strings, floats, ints, etc...


Example
- fp := dms.fopen('myfile', 'w')
- sourcename := 'mySource'
- hour := 12
- minute := 4
- seconds := 42.3
- dms.fprintf(fp,'%s %02d:%02d:%05.2f\n', sourcename, hour, minute, seconds)
- dms.fclose(fp)
T
In this example you'd get the following in myfile

mySource 12:04:42.30





next up previous contents index
Next: misc.fgets - Function Up: misc - Tool Previous: misc.fclose - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15