Common Dialog for Saving

Serge

New Member
Hi there,

Someone knows how to display a common dialog box to save a file?

Following code can be used to open a file:

def var l-file as char no-undo.
system-dialog
get-file l-file
must-exist.
message l-file.

Is there also something for saving a file? Or should I use the Common Dialog OCX?

Thx !
 

Osborne

Active Member
Serge, is this what you are looking for?:-

def var l-file as char no-undo.
def var v-ok as log.

SYSTEM-DIALOG GET-FILE l-file
TITLE "Specify output file..."
FILTERS "Text (*.txt)" "*.txt"
SAVE-AS
ASK-OVERWRITE
USE-FILENAME
DEFAULT-EXTENSION ".txt"
UPDATE v-ok.

IF v-ok THEN MESSAGE l-file view-as alert-box information.
 

Serge

New Member
Thanks a lot Osborne for the quick respons.

This is exactly what I need.

Just 1 more question: - Which delimiter do I use to define more filters?

example:

SYSTEM-DIALOG GET-FILE l-file
TITLE "Specify output file..."
FILTERS "Text (*.txt)" "*.txt" | "Proc (*.p)" "*.p" ...
SAVE-AS
ASK-OVERWRITE
USE-FILENAME
DEFAULT-EXTENSION ".txt"
UPDATE v-ok.
 

Osborne

Active Member
The comma delimiter. E.g.:-

FILTERS "Text (*.txt)" "*.txt", "Proc (*.p)" "*.p", "All Files" "*.*"
 
Top