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
  • chdir()
  • chmod()
  • compile()
  • copyfile()
  • delfile()
  • delident()
  • dirinfo()
  • diskfree()
  • DO
  • execprog()
  • firstdir()
  • flush()
  • getdir()
  • getenv()
  • getident()
  • getpara()
  • getsize()
  • halt()
  • isfile()
  • makedir()
  • nextdir()
  • pause()
  • privdir()
  • remdir()
  • rename()
  • setcgilog()
  • setident()
  • setpara()
  • testident()
  • timeout()
  • today()
  • varname()
    Table functions
    Text functions
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex System functions
    Function getident()
    Short Gets an entry from a configuration file
    Syntax GETIDENT(ini, ident : STRING) : STRING
    Parameter ini : path of the configuration file
    ident: name of the searched value
    Return The searched value from the configuration file
    See also:
    setident() delident() testident()
    Description Special text files are configuration files and templates. tdbengine supports configuration files of the following style:

    Configuration files

    [Group 1]
    Entry1=...
    Entry2=...
    ...
    [Group 2]
    Entry1=...
    Entry2=...
    ...

    Every entry can be composed of 255 chars.

    To work with such files EASY has two functions: SETIDENT and GETIDENT:

    SETIDENT(config_file,entry,value)
    writes an entry=value to config_file

    GETIDENT(config_file,entry)
    returns the value of entry

    Entries are specified in that way: »group.entry«

    Example:
     PROCEDURE Main
     VAR ini : STRING
       ini:='test.ini'
       cgiwriteln('content-type: text/html')
       cgiwriteln('')
       SETIDENT(ini,'Administrator.Name','Hans Huber')
       SETIDENT(ini,'Administrator.Password','secret')
       SETIDENT(ini,'Database.Addresses','database/address.dat')
       cgiclosebuffer
       copyfile(ini,'con')
     ENDPROC

    Dieses kleine Programm legt die Datei »test.ini« mit folgendem Inhalt an:

    [Administrator]
    Name=Hans Huber
    Password=secret
    [Database]
    Addresses=database/address.dat

    Note: Then the created file is outputted to the screen too. Here the use of »CGICLOSEBUFFER« is important, that the internal buffer is outputted before the copying.

    With GETIDENT the single entries can be read.

    Example:

    GETIDENT('test.ini','Administrator.Name) -> 'Hans Huber'
    GETIDENT('test.ini',Database.Addresses) -> 'database/address.dat'

    Note: Within the first access to a configuration file, it is completely read to the memory of the computer and is provided to the programm via a tree structure. That is why the access is very fast.

    Configuration files replaces databases in many cases!

    User comments:
    GetIdent("","") löscht Puffer
    User: H. GötzDate: 12.12.2005 09:34#22
    wichtig, wenn sich der Inhalt der Ini-Datei ändert und man sicherstellen möchte, daß nicht ausd dem Puffer gelesen wird
    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"}