local m.x,lcfilename,mynewFolder m.mynewFolder=home(1) m.x=sys(5)+sys(2003) &¤t dir set defa to (m.mynewfolder ) m.lcfilename=getfile("app") &&any extension messagebox(m.lcfilename) set defa to (m.x)2. the showOpen standard windows dialog box to open file(mscomdlg.commondialog class activeX) have the same behavior.vfp one is maybe derived from.
loComDialog = createobject("mscomdlg.commondialog") with loComDialog .Filter = "All Files (*.*)|*.*|Text Files(*.txt)|*.txt|Batch Files (*.bat)|*.bat" .MaxFileSize=100 .ShowOpen() MESSAGEBOX(.FileName) endwith3.you can tweak the vfp getdir() (folder browse dialog) function to handle as well the files.
local lcfilename lcfilename=getdir(home(1),"open filename ","browse for filenames/folders",16384) if not empty(m.lcfilename) m.lcfilename=substr(m.lcfilename,1,len(m.lcfilename)-1) messagebox(m.lcfilename) endi *update: can use also : JUSTPATH(m.lcfilename)update: for whose can use scripts there many good solutions of VBScript File Browser in :
https://gist.github.com/mlhaufe/1034241