1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

SYSTEM-DIALOG GET-FILE with dynamic file type filters

Discussão em 'StackOverflow' iniciado por fdantas, Outubro 4, 2018.

  1. fdantas

    fdantas Administrator Moderador

    Using OpenEdge 11.7 and Windows 7, I'm searching for a disk file using this working code:

    DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
    DEFINE VARIABLE lChose AS LOGICAL NO-UNDO.

    SYSTEM-DIALOG GET-FILE cFileName
    FILTERS "Text Files (*.txt)" "*.txt", "Comma-Separated Value Files (*.csv)" "*.csv"
    UPDATE lChose.


    Is there a way to dynamically build the filter list with a variable? I've tried this, which doesn't work:

    DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
    DEFINE VARIABLE cFilters AS CHARACTER NO-UNDO.
    DEFINE VARIABLE lChose AS LOGICAL NO-UNDO.

    cFilters = '"Text Files (*.txt)" "*.txt", "Comma-Separated Value Files (*.csv)" "*.csv"'.

    SYSTEM-DIALOG GET-FILE cFileName
    FILTERS cFilters
    UPDATE lChose.


    I've also tried:

    FILTERS VALUE(cFilters)


    Both return an "unable to understand" error (198). Can this even be done?

    Continue reading...

Compartilhe esta Página