Page 1 of 1
Fifth parameter of GetFile()
Posted: Mon Sep 15, 2008 9:14 pm
by esgici
Hi All
Any experiment on fifth ( last ) parameter ( <
lNoChangeDir> ) of GetFile() ?
I am expecting that if it's default value is .F. and when is .T. user don't have ability for changing
DIR/Folder while selecting file(s).
But whatever this value is, GetFile() always allows changing DIR/Folder to user.
Either my expection is wrong or I am missed another thing(s)
Any opinion ?
( XP-SP2, HMG-2.6.4 )
Regards
--
esgici
Re: Fifth parameter of GetFile()
Posted: Tue Sep 16, 2008 5:03 am
by Rathinagiri
IMHO it is not the option given to the user not to change the directory he selects. But it is the value of the 'current directory' system variable. If you want to change the value of the system variable to that particular directory after the user selects, you use .t. otherwise, if it is only to select the file and the current directory variable should be in tact, you have to use .f.
Please consider this small example.
Code: Select all
# include "minigui.ch"
function main
define window sample at 0,0 width 200 height 200 main
define button get1
row 10
col 10
caption "with .t."
action getfilewithtrue()
end button
define button get2
row 40
col 10
caption "with .f."
action getfilewithfalse()
end button
end window
sample.center
sample.activate
return nil
function getfilewithtrue
g := getfile({ {'All Files','*.*'} } , 'Select a File' , 'c:\' , .f. , .t.)
msginfo(getcurrentfolder())
return nil
function getfilewithfalse
g := getfile({ {'All Files','*.*'} } , 'Select a File' , 'c:\' , .f. , .f.)
msginfo(getcurrentfolder())
return nil
Re: Fifth parameter of GetFile()
Posted: Tue Sep 16, 2008 1:24 pm
by esgici
Thanks a lot Rathi
Understood; it'is : <
lNoChangeCurrDir>
Thanks again you have interested and solved my problem
Regards
--
esgici
Re: Fifth parameter of GetFile()
Posted: Wed Sep 17, 2008 1:35 am
by Rathinagiri
Yes in deed.
Regards.