Contact | Privacy | Datenschutzerklärung | Impressum

readFileLines

Format: readFileLines (file [, fromline [, numlines]])

Purpose: Reads (part of) a text file. The parameter file must be a filename and of type string, fromline and numlines are integers. If fromline is not given it defaults to 0. If numlines is not given it defaults to all lines starting from fromline to the end of the file.

Return Values: If the file was read successfully, an array is returned with numlines elements where element i contains line fromline+i of the file with name file. If an error occurred while reading the file, a string is returned denoting the error message.

Configuration: The function is not allowed in secure mode.

Example:

// This example shows how to use the readFileLines function and the
// writefile tag to implement an appendfile function:

<defenv appendFile f;
 c=readFileLines(f);
 writefile f;
 ? c "\r\n%A";
 defbody;
/writefile;
/defenv>

See Also: copyfile(), deletefile(), directory(), mkdir(), movefile(), stat(), utime(), writefile.


This page was dynamically generated by the web application development tool RADpage of H.E.I. Try the AJAX Article (in German) on www.h-e-i.de.
© 1996-2024 H.E.I. All Rights Reserved.



Homepage
Intro/Features
Component Guide
Programming
  Language Guide
  Language Ref.
    General Design
    Lexical Structure
    Expressions
    Objects
    Methods
    Classes
    heitml Tags
    heitml Functions
      ArAppend
      ArConcat
      ArSearch
      array
      asc
      caltime
      chr
      class
      clone
      contains
      ContainsCase
      copy
      copyfile
      crypt
      _dbcolumns
      _dbforeignkey
      _dbprimarykey
      _dbtables
      _dbtypes
      default
      deletefile
      difftime
      directory
      findex
      flush
      fname
      gmtime
      htmlbool
      http_content_type
      http_empty_document
      http_expires
      http_header
      http_last_modified
      http_location
      http_set_cookie
      http_request_header
      _includefilepreprocessed
      index
      IndexCase
      integer
      isbool
      isdecl
      isempty
      isinteger
      isnull
      isstring
      istuple
      isreal
      left
      len
      localtime
      MD5
      mkdir
      mktime
      movefile
      offstotabcol
      random
      readFileLines
      _readini
      _readodbcdrv
      _readodbcdsn
      real
      resize
      right
      _serverdocroot
      _shelltemp
      srandom
      splitstring
      stat
      strftime
      strptime
      subst
      substall
      substring
      tabcoltooffs
      tolower
      toupper
      trim
      trimleft
      trimright
      TuAppField
      TuAssField
      TuAssign
      TuSlice
      TuDelField
      TuFieldSort
      TuInsField
      TuMerge
      TuName
      TuProject
      utime
      _writeini
    Advanced Functions
    Database Access
    Global Variables
    Form Fields
    Server Variables
    Sessions
    heitml Syntax
  Component Ref.
  Class Library
  User Components
  Tutorial
  New Features
  heitml 1
User Guide
Services
Privacy
Datenschutz
 
Contact / Impressum