[Index for tmp_for_tar/imgio] [Return to Master Index]

advance_until

(tmp_for_tar/imgio/advance_until.m)


Function Synopsis

ok = advance_until (fid, c)

Help text

 ok = advance_until (fid,c)   - Advance until character c is found

 advance_until (fid,c) reads one char at a time from fid until the
 character c is found, or until the file can't be read. It returns true if
 the character was found, false otherwise.

 Last modified: Setembro 2002



Cross-Reference Information

This function is called by

Listing of function file tmp_for_tar/imgio/advance_until.m

## ok = advance_until (fid,c)   - Advance until character c is found
##
## advance_until (fid,c) reads one char at a time from fid until the
## character c is found, or until the file can't be read. It returns true if
## the character was found, false otherwise.

## Author:        Etienne Grossmann  <etienne@isr.ist.utl.pt>
## Last modified: Setembro 2002

function ok = advance_until (fid, c)

  if isstr (c), c = toascii (c); end

  [cc,ok] = fread (fid,1,"char");
  if !ok, return; end

  while cc != c
    [cc,ok] = fread (fid,1,"char");
    if !ok, break; end
  end
    

Produced by oct2html on Sat Sep 14 9:47:03 2002
Cross-Directory links are: ON