fgl_file_dialog()

Calls a file dialog where a user can open or save files.

Syntax

fgl_file_dialog("type","multiselect"[,"title"] [,default_path] [,"default_file_name"] [,"format"])

Parameters and values

type

type of the dialog box (STRING): {open, save}

multiselect

enables multi-selection (STRING): {0, 1}

1 = disabled (only a single file can be selected at a time),

0 = enabled (multiple files can be selected)

title

(optional) dialog title (STRING)

default_path

(optional) default file path for the dialog (STRING)

default_file_name

(optional) default file name suggested in the file name filed of the dialog  (STRING)

format

(optional) default file format for the files selectable in the dialog (STRING)

All the file names you use in your 4gl development must be platform-independent.

If you use platform-dependent names (e.g., combine upper and lower case, use colons, finish names with a full stop, etc.), please remember that they might cause different problems when you move your project to another platform.

Usage and examples

With LyciaDesktop, allows opening and/or saving the selected files:

example code #1

MAIN
DEFINE picked_file STRING
DEFINE base_path STRING
LET base_path = fgl_winprompt(5,5,"Enter the base path","", 50, 0)
LET picked_file = fgl_file_dialog("save","1","Please, select the file",base_path,"lycia","*.png") 
END MAIN

obtained results #1

example code #2

MAIN
DEFINE picked_file STRING
DEFINE base_path STRING
LET base_path = fgl_winprompt(5,5,"Enter the base path","", 50, 0)
LET picked_file = fgl_file_dialog("open","1","Please, select the file",base_path,"","*.png") 
END MAIN

obtained results #2

Because of standard browser limitations, the dialog cannot be opened via LyciaWeb (since web browsers do not except handling files on the client side).

In this case, you will get the error message - Cannot open the file on this client:

If you use Google Chrome for your 4gl applications, you can overcome this restriction by installing the LyciaWeb extension for Google Chrome.

 

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.