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.readfile - Function Up: misc - Tool Previous: misc.fprintf - Function


misc.fgets - Function



Package utility
Module misc
Tool misc


interface to fgets


Synopsis
fgets(fileid, filler)


Description
Get a string buffer from a file. fgets is similar to the C function fgets but different in a couple of key ways. First it reads up to 500 characters or until a new line is reached in the file. Unfortunately 500 is hard-coded (the current implementation requires this, you don't want to know). Second, if you supply a fill character it will replace blank characters with your fill character.



Arguments

fileid   File id
    Allowed: file id as returned by fopen
filler   string buffer to replace blanks
    Allowed: String
    Default: ''


Returns
Contents of current line in the file


Example
- fp := dms.fopen('myfile', 'r')
- a := dms.fgets(fp)
- print a
mySource 12:04:42.30

dms.fgets(fp) will return 0 when it reaches the end of file.



next up previous contents index
Next: misc.readfile - Function Up: misc - Tool Previous: misc.fprintf - 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