Could you please modify sligthly your code , from lines 38 to 59, just to avoid chose a folderpath every time that the aplication starts, in my special case where Hmgpath can´t be located in the windows registry, and the Hmg Folder is in other Unit ("D:") and in other unsual path: ("D:\User1\Docs\work\hmg")
Original Code:
Code: Select all
If Len( aHMG_PATH ) = 0
Do While .t.
HMG_PATH := GetFolder('Select HMG Folder',,,.F.,.T.,,BIF_NONEWFOLDERBUTTON)
If Empty( HMG_PATH )
Exit
Else
If File(HMG_PATH+"\Version.txt")
cVer:=hb_MemoRead(HMG_PATH+"\Version.txt")
If "(" $ cVer
cVer:=AllTrim(SubStr(cVer,1,At("(",cVer)-1))
Endif
If MsgYesNo("Do you want to use HMG "+cVer+" ?","Please confirm HMG_PATH")
Exit
Endif
Else
MsgInfo("It seems not a HMG folder !","Try again...")
Endif
Endif
Enddo
Else
HMG_PATH := aHMG_PATH[1,2]
Endif
Code: Select all
If Len( aHMG_PATH ) = 0
If file("FMG_Editor.ini")
HMG_PATH:=hb_MemoRead("FMG_Editor.ini")
Else
Do While .t.
HMG_PATH := GetFolder('Select HMG Folder',,,.F.,.T.,,BIF_NONEWFOLDERBUTTON)
If Empty( HMG_PATH )
Exit
Else
If File(HMG_PATH+"\Version.txt")
cVer:=hb_MemoRead(HMG_PATH+"\Version.txt")
If "(" $ cVer
cVer:=AllTrim(SubStr(cVer,1,At("(",cVer)-1))
Endif
If MsgYesNo("Do you want to use HMG "+cVer+" ?","Please confirm HMG_PATH")
hb_MemoWrit("FMG_Editor.ini",HMG_PATH)
Exit
Endif
Else
MsgInfo("It seems not a HMG folder !","Try again...")
Endif
Endif
Enddo
Endif
Else
HMG_PATH := aHMG_PATH[1,2]
Endif