IF FULLPATH(curdir()) != lcOldDir **** this is where I am having problems * To IF NOT( FULLPATH(curdir()) == lcOldDir)The help for SET EXACT Command explains why. Also CD command doesn't generate an error if you try to swith to the current VFP directory.
>WITH thisform > LOCAL lcNewDir,lcOldDir,z,d,f && z=returned path and filename, p=path split, f=file split > > lcOldDir = .Dirloc1.gv_fullpath > lcNewDir = .Dirloc1.gv_docpath > IF FULLPATH(curdir()) != lcNewDir > CD (lcNewDir) > ENDIF > .z = GETFILE() && get directory and file name > b = RAT('\',.z) && find last '\' > l = LEN(.z) > .f = right(.z,ABS(b-l)) && file > .d = left(.z,b) && directory path > > IF FULLPATH(curdir()) != lcOldDir **** this is where I am having problems > CD (lcOldDir) > ENDIF > IF VARTYPE(.z) = "C" AND !EMPTY(.z) > .t1.value = ALLTRIM(.z) > .t2.setfocus() > .t2.refresh() > ELSE > MESSAGEBOX('No file was choosen',0,'Warning') > ENDIF >ENDWITH >>
>.Dirloc1.gv_fullpath = c:\programming\programs\vfp8\contract_track >and >.Dirloc1.gv_docpath = c:\programming\programs\vfp8\contract_track\documents\ >>