Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 2 Jahren, 4 Monaten
Letzter Beitrag:
vor 2 Jahren, 4 Monaten
Beteiligte Autoren:
Amal Murali, Viggo Poulsen, ICI

Change Directory

Startbeitrag von Amal Murali am 01.02.2016 05:30

Hi all,

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

sDir1 is string=STOCK..Directory................ // ".\Data\Year15"
I want to create a new directory for the next year ie ".\Data\Year16"

HchangeDirectory and Hcreate is working for changing directories..But I need to name the directories 1 year ahead of the current one..

I retrieve the rightmost 2 characters from the string ie 15 and increment it to 16..then add it to the old path..Ia dere any other way??

How can it be possible?

Plz Help

Antworten:

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

von Viggo Poulsen - am 01.02.2016 08:09
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

von Amal Murali - am 01.02.2016 08:26
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

von Viggo Poulsen - am 01.02.2016 09:29
Hi viggo,
I am using Hyperfilesql itself..WD20

von Amal Murali - am 01.02.2016 09:52
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

von Viggo Poulsen - am 01.02.2016 11:23
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))

von ICI - am 06.02.2016 11:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.