Fifth parameter of GetFile()

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

Post Reply
User avatar
esgici
Posts: 4336
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 221 times
Been thanked: 77 times
Contact:

Fifth parameter of GetFile()

Post by esgici » Mon Sep 15, 2008 9:14 pm

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
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 130 times
Contact:

Post by Rathinagiri » Tue Sep 16, 2008 5:03 am

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
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
esgici
Posts: 4336
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 221 times
Been thanked: 77 times
Contact:

Post by esgici » Tue Sep 16, 2008 1:24 pm

Thanks a lot Rathi :)

Understood; it'is : <lNoChangeCurrDir>

Thanks again you have interested and solved my problem :)

Regards

--

esgici
Viva INTERNATIONAL HMG :D

User avatar
Rathinagiri
Posts: 5162
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 128 times
Been thanked: 130 times
Contact:

Post by Rathinagiri » Wed Sep 17, 2008 1:35 am

Yes in deed.

Regards.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply