Deutsch English
Alphabetical index
Array functions
CGI functions
Data types
Date functions
Fulltext functions
Language elements
Numerical functions
Other functions
  • choice()
  • dat2dbf()
  • dbf2dat()
  • execmacro()
  • getsession()
  • md5_str()
  • nloop()
  • note()
  • note_a()
  • note_b()
  • note_i()
  • paramstr()
  • todbf()
  • xwert()
    Ramtext functions
    Socket functions
    Statistical functions
    Stream functions
    String functions
    System functions
    Table functions
    Text functions
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex Other functions
    Function choice()
    Short Choose a value from a list
    Syntax Choice(Zahl: INTEGER;Ausdruck1,Ausdruck2,..., AusdruckN): Real/String
    Return The funtion returns that expression which has the number num. If num is not in the area from 1 to N, the function returns the last expression exprN. Depending on the type of the expression the function returns a string or a numeric type.
    See also:
    Description The numeric expression num is calculated (results n). Subsequent the n'th expression is calculated and returned as the result of the function. If there is no n'th expression the last expression of the series is calculated.


    Choice(x,"one","two","three") -> "one" for x = 1
    -> "two" for x = 2
    -> "three" else
    Choice(5,"one","two","three") -> "three"

    Very useful is this function for expample to evaluate selection fields. Internal selection fields have the value 0 if they are empty, otherwise 1 if the first value is selected, 2 if the second one...
    In the following example "sex" is a selection field with the constants "female", "male" and "unknown".

    Choice(sex,"Dear Mrs. "+$Name,"Dear Mr. "+$Name,"To Whom It May Concern")

    User comments:
    Write a comment:
    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

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