GetCurrentFolder()

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
ROBROS
Posts: 107
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 42 times
Been thanked: 7 times

GetCurrentFolder()

Post by ROBROS » Thu Jun 28, 2018 8:32 am

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
Attachments
path_shown_correctly.JPG
path_shown_correctly.JPG (40.56 KiB) Viewed 188 times
ERROR.JPG
ERROR.JPG (37.81 KiB) Viewed 188 times

edk
Posts: 307
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 85 times
Been thanked: 234 times

Post by edk » Thu Jun 28, 2018 11:01 am

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.

ROBROS
Posts: 107
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 42 times
Been thanked: 7 times

Post by ROBROS » Thu Jun 28, 2018 11:55 am

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

edk
Posts: 307
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland
Has thanked: 85 times
Been thanked: 234 times

Post by edk » Thu Jun 28, 2018 12:05 pm

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")

ROBROS
Posts: 107
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Has thanked: 42 times
Been thanked: 7 times

Post by ROBROS » Thu Jun 28, 2018 12:12 pm

Hi edk,

is working.
Thank you very much.
Robert

Post Reply