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 readln()
    Short Reads a line from a text file
    Syntax READLN(t : INTEGER) : STRING
    Parameter t : text handle from RESET
    Return next line from the text file.
    See also:
    read() reset()
    Description Depending on the operating system it is read till the next word wrap.

    A word wrap is defined as


    * CRLF (Win32)
    * LF (Linux, FreeBSD) // CR is ignored here
    * EOT (=^Z under Win32, ^D under Linux, FreeBSD)
    * physical end of file

    In the current version a line can has maximal 255 chars.

    Attention: If a text file is saved in ANSI format, it has to be opened with reset(....,0).

    Example 1: Timeout + ReadLn from console

    The user has 10 seconds to enter his account ID.

    PROCEDURE Input : INTEGER
    VAR id : STRING
      Timeout(10)
      writeln(0,'Your account id: ')
      id:=readln(0)
      TimeOut(0)
      RETURN 1
    ENDPROC
    
    PROCEDURE Main
      cgiclosebuffer
      IF Input THEN
        writeln(0,'Your input will be processed now...')
      ELSE
        writeln(0,'Cancel forced by timeout')
      END
    ENDPROC
    


    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"}