Deutsch English
Alphabetical index
Array functions
CGI functions
Data types
Date functions
Debugging
Fulltext functions
Language elements
Numerical functions
Operators
Other functions
Ramtext functions
Selecting
Socket functions
Statistical functions
Stream functions
String functions
System functions
Table functions
Text functions
  • close()
  • convline()
  • eot()
  • read()
  • readln()
  • reset()
  • rewrite()
  • tappend()
  • write()
  • writeln()
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex Text functions
    Function read()
    Short Reads the string from a text file
    Syntax READ(t : INTEGER[; n : INTEGER | c : CHAR]) : STRING
    Parameter t : text handle from RESET
    n : 1 to 255 (number of chars that are to read)
    c : any char

    Is n and c not specified: it is default n=1.

    Return String with n chars from text file if c is not specified.
    Otherwise maximal 255 chars from the text file until the char c is read. This char is not returned.
    See also:
    readln() reset()
    Description The text file has to be opened to read with RESET.

    Example: Complete output to text file:
    VAR t : INTEGER
    VAR c : STRING
      SetPara('ec 1') // IO-error handling
      IF t:=reset('/home/tdbengine/doc/index.html',0)
      THEN
        WHILE NOT EOT(t) DO CgiWrite(READ(t)) END
        Close(t)
      ELSE
        CgiWriteHtlm('File can not be opened.')
      END

    Important: If t=0, it is read from StdIn, which leads to a "hanging" programm at CGI applications!

    User comments:
    Write a comment:
    Name
    EMail
    Subject
    Text (Switch mode)

    Choose between
    the normal and the
    advanced editor.
    The advanced editor
    runs in IE 5+ and
    Mozilla 1.4+ only
    SPAM-Protection Please enter tdbengine in this field.

    tdbengine chat
    irc.tdbengine.org
    #tdbengine

       Copyright © 2003-2004 tdb Software Service GmbH
       Alle rechte vorbehalten. / All rights reserved
       Last changed: 21.10.2004
    {Fehler für :execmacro{execmacro="sessionspy"}