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
GetCurrentFolder()
Moderator: Rathinagiri
-
- Posts: 415
- Joined: Thu Oct 16, 2014 11:35 am
- Location: Poland
- Has thanked: 123 times
- Been thanked: 330 times
Show us row 58 of the KOP_REPORT function.
It looks like it was wrong to call the COPY FILE function, for example: instead of
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.
It looks like it was wrong to call the COPY FILE function, for example:
Code: Select all
COPY FILE .... TO path + "asbeweg.dbf"
Code: Select all
COPY FILE .... TO (path + "asbeweg.dbf")
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.
-
- Posts: 159
- Joined: Thu May 25, 2017 6:30 pm
- DBs Used: DBF
- Has thanked: 48 times
- Been thanked: 13 times
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
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
-
- Posts: 415
- Joined: Thu Oct 16, 2014 11:35 am
- Location: Poland
- Has thanked: 123 times
- Been thanked: 330 times
Correct should be: or
Code: Select all
copy file s:\as5win\daten1\asbeweg.dbf to (path+"asbeweg.dbf")
Code: Select all
copy file s:\as5win\daten1\asbeweg.dbf to &(path+"asbeweg.dbf")