[Gambas-user] Obtaining desired file extension

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 9 15:04:03 CET 2021


On 2/9/21 12:32 AM, Bruce Steers wrote:
> On Tue, 9 Feb 2021 at 01:58, martin cristia <tercoide at hotmail.com <mailto:tercoide at hotmail.com>> wrote:
> 
>     In the Dialog.SaveFile() user is asked for a filename, given a few
>     extension options, i.e:
> 
>     Dialog.Filter = ["*.dxf", "DXF Drawing exchange 2010", "*.dwg", "DWG
>     AutoCAD Drawing file 2010"]
>     If Dialog.SaveFile() Then Return ' cancel saving
>     f = Dialog.Path
> 
>     then user types "my saved file" , sets extension in ComboBox, but
>     Dialog.Path comes without it; and AFAIK there is no way to get that , or
>     I'm not seeing it????
> 
> 
> gb.form.dialog and the AutoExt property
> 
> http://gambaswiki.org/wiki/comp/gb.form.dialog/dialog <http://gambaswiki.org/wiki/comp/gb.form.dialog/dialog>
> BruceS

Good catch, Bruce. I missed that.

Simply use gb.form.dialog and add in "Dialog.AutoExt = True" prior to calling the Dialog. Easy.


-- 
Lee


More information about the User mailing list