PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Change Directory
Change Directory
Iniciado por guest, 01,feb. 2016 06:30 - 6 respuestas
Publicado el 01,febrero 2016 - 06:30
Hi all,

I am trying to change the directory of a particular datafile named "stock"

sINIDir1 is string=STOCK..Directory
HChangeDir(STOCK , sINIDir1+["\"]+"New")
info(STOCK..Directory)

so the result i got is ".\olddirectorypath\New"..ie directory changed..But Physically in HFSQLControl Centre ,New Directory not at all created...

fMakeDir(sINIDir1+["\"]+"NewDir")
Here also same problem..New dirctory created..But no such directory in HFSQL Control Centre..

Plz Help
Publicado el 01,febrero 2016 - 09:09
Hi Amal
If Hcreate is working for you then the new directory string must be wrong.
First: After creating the new directory string, check the content of this string ( Info, Trace or another way of showing it).
If this does not solve the problem, then please write the code you are using to create the new directory string, so we can see what is wrong.

Best regards
Viggo Poulsen
Publicado el 01,febrero 2016 - 09:26
sIniDir is string=STOCK..Directory ................// ".\FCOMM\YR15"
yr is int=(Right(sIniDir,2))
yr++
HChangeDir(STOCK,".\FCOMM"+["\"]+"YR"+yr)
HCreation(STOCK)
info(STOCK..Directory) .............................//".\FCOMM\YR16"


If i use HCreation along with HChangeDir , new directory get created in the designated path with the datafile...But somthng is wrong..ie executing next time also the currentdirectory is the old one..YR15..

HchangeDir alone wont give the exact result..thats y I choose Hcreate along with changeDir..But there also some probs

Any solution
Publicado el 01,febrero 2016 - 10:29
Hi Amal

You are not telling us, if you are using HyperfileSql or another DB. If it is not HyperfileSql then the help on HChangedir may give you a hint :
"To modify the connection parameters of a data file not in HyperFileSQL format, we recommend that you use HDescribeConnection and HChangeConnection."

Another thing you can test: Try avoiding .\ as it depends too much on variable paths. Try to use the exact path instead, eg. C:\Myprog\......

Best regards
Viggo Poulsen
Publicado el 01,febrero 2016 - 10:52
Hi viggo,
I am using Hyperfilesql itself..WD20
Publicado el 01,febrero 2016 - 12:23
Hi Amal

Did you try this : Try avoiding .\ as it depends too much on variable paths. Try to use the exact path instead, eg. C:\Myprog\\FCOMM\YR16

Best regards
Viggo Poulsen
Publicado el 06,febrero 2016 - 12:57
Hi Amal

If you are using manual connection to HFSQL Server then you need to:

1. HChangeConnection(MyDataFile,gctMyConnection)
2. create variable for data path:
a) sMyPathToFile is string = "FCOMM\"+"YR"+yr
b) HChangeDir(MyDataFile,".\"+NoSpace(sMyPathToFile))