Page 1 of 1

GetCurrentFolder()

Posted: Thu Jun 28, 2018 8:32 am
by ROBROS
Hi all,
the following code compiles without error:

path:=GetCurrentFolder()+ "\"

MsgInfo(path) shows the right path, but when continuing I get a runtime error. pls see attached screen shots.

What is wrong?

Thank you
Robert

Re: GetCurrentFolder()

Posted: Thu Jun 28, 2018 11:01 am
by edk
Show us row 58 of the KOP_REPORT function.
It looks like it was wrong to call the COPY FILE function, for example:

Code: Select all

COPY FILE .... TO path + "asbeweg.dbf"
instead of

Code: Select all

COPY FILE .... TO (path + "asbeweg.dbf")
Syntax:
COPY FILE <xcSourceFile> TO <xcTargetFile>|<xcDevice>

Arguments:
<xcSourceFile> is the name of the source file to copy including the extension.

<xcTargetFile> is the name of the target file including the extension.

Both arguments can be specified as literal file names or as character expressions enclosed in parentheses.

Re: GetCurrentFolder()

Posted: Thu Jun 28, 2018 11:55 am
by ROBROS
THx for replying, here comes line 58:

copy file s:\as5win\daten1\asbeweg.dbf to path+"asbeweg.dbf"

These 2 lines work fine:
copy file s:\as5win\daten1\asinfo.dbf to c:\lastwe\asinfo.dbf
copy file s:\as5win\daten1\asart.dbf to c:\lastwe\asart.dbf

Robert

Re: GetCurrentFolder()

Posted: Thu Jun 28, 2018 12:05 pm
by edk
Correct should be:

Code: Select all

 copy file s:\as5win\daten1\asbeweg.dbf to (path+"asbeweg.dbf") 
or

Code: Select all

copy file s:\as5win\daten1\asbeweg.dbf to &(path+"asbeweg.dbf")

Re: GetCurrentFolder()

Posted: Thu Jun 28, 2018 12:12 pm
by ROBROS
Hi edk,

is working.
Thank you very much.
Robert