GetCurrentFolder()

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

GetCurrentFolder()

Post 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
Attachments
path_shown_correctly.JPG
path_shown_correctly.JPG (40.56 KiB) Viewed 2210 times
ERROR.JPG
ERROR.JPG (37.81 KiB) Viewed 2210 times
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: GetCurrentFolder()

Post 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.
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: GetCurrentFolder()

Post 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
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: GetCurrentFolder()

Post 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")
ROBROS
Posts: 256
Joined: Thu May 25, 2017 6:30 pm
DBs Used: DBF
Location: D 83071 Stephanskirchen

Re: GetCurrentFolder()

Post by ROBROS »

Hi edk,

is working.
Thank you very much.
Robert
Post Reply