Deutsch English
Alphabetical index
Array functions
  • bitand()
  • bitandnot()
  • bitnot()
  • bitor()
  • bitsum()
  • bittrunc()
  • clrarray()
  • 'DELSESSION'
  • getauto()
  • getmarksauto()
  • high()
  • inarray()
  • inarraypos()
  • initarray()
  • nbits()
  • putmarksauto()
  • 'SETSESSIONIDENT'
  • strsort()
    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
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex Array functions
    Function strsort()
    Short Sorts one and two dimensional STRING arrays
    Syntax STRSORT(StrArray : STRING[]; MaxIndex : INTEGER [;FirstIndex : INTEGER [; SortStr : STRING]]) : INTEGER
    Parameter StrArray : one or two dimensional STRING array
    MaxIndex : the array is sortet from FirstIndex to MaxIndex
    FirstIndex : Index, wherefrom the array shall be sorted (0=default)
    SortStr : sort sequence
    Return 0 or error code (if it is no string array)
    See also:
    Description The fields are always sorted line by line.
    StrSort() defines how the field will be sorted. It is composed of the number of the columns (whom a minus can be prefixed if the sort sequence shall be descending).
    Additional you can prefix a '%'-character to a column if it is a absolute numeric column. Then it is sorted in conformity with this.

    Example 1: StrSort

    Cross join of two tables sorted by the 1st and 2nd column

    VAR db_1 : INTEGER = opendb('database/customer.dat')
    VAR db_2 : INTEGER = opendb('database/orders.dat')
    VAR query : STRING = '$customer.KDNR=$orders.KDNR, $orders.date<=today-14'
    VAR result : STRING[,]
    VAR i,j : INTEGER
    InitArray(result[maxlabel(db_1)+maxlabel(db_2),filesize(db_1)*filesize(db_2)]
    
    SUB _query
    nloop(i,maxlabel(db_1)-1,result[j,i]:=getfield(db_1,i+1))
    nloop(i,maxlabel(db_2)-1,result[j,maxlabel(db_1)+i]:=getfield(db_2,i+1))
    j++
    ENDSUB
    StrSort(result,j-1,0,'1,2')


    User comments:
    strsort()
    User: HoHeSiDate: 01.11.2004 06:39#4
    Warum finde ich "strsort()" nicht unter
    --> Array-Funktionen
    (--> Sonstige-Funktionen)
    sondern nur unter --> String-Funktionen?
    Hier hätte ich zuletzt gesucht, da ich primär ein Array sortieren wollte.

    Zum Glück gibt es ja auch den alphabetischen Index ;-)

    Gruß HoHeSi
    StrSort() jetzt eine Array-Funktion
    User: thomasDate: 01.11.2004 10:54#6
    Vielen Dank für den Hinweis.

    Habe es korrigiert.
    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"}