1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Stackoverflow]

Discussão em 'StackOverflow' iniciado por fdantas, Julho 18, 2025.

  1. fdantas

    fdantas Administrator Moderador

    I'm currently creating a report program with a freeform query.

    Some users requested about the possibility of sorting by any of these columns. This part itself is done, and it´s working.

    My question is:

    Using the BROWSE br:CURRENT-COLUMN, how can I get the index to use into SET-SORT-ARROW()?

    This is my working code:

    DO:

    DEFINE VARIABLE hCol AS HANDLE.
    DEFINE VARIABLE qh AS HANDLE.

    IF cBrowserSort = "" THEN
    cBrowserSort = "DESCENDING" .
    ELSE
    cBrowserSort = "".

    ASSIGN hCol = BROWSE br:CURRENT-COLUMN
    qh = QUERY br:HANDLE
    cBy = "by temp" + STRING(hCol:NAME).

    qh:QUERY-PREPARE("FOR EACH TT-Component NO-LOCK BY " + hCol:NAME + " " + cBrowserSort + ":").
    qh:QUERY-OPEN().

    br:CLEAR-SORT-ARROWS().

    //br:SET-SORT-ARROW(hCol:NAME, cBrowserSort EQ "").

    END.

    Continue reading...

Compartilhe esta Página