XSharpPublic icon indicating copy to clipboard operation
XSharpPublic copied to clipboard

COPY TO command problems

Open cpyrgas opened this issue 8 months ago • 1 comments

From https://www.xsharp.eu/forum/topic?p=33785#p33785

FUNCTION Start() AS VOID
LOCAL cDbf AS STRING
LOCAL cTarget AS STRING
cDbf := "c:\dbf\testcopy"
cTarget := "c:\dbf\target"
DbCreate(cDbf,{{"FLD1","N",10,5},{"FLD2","C",10,0}})
DbUseArea(TRUE,,cDbf,"source")
DbAppend();FieldPut(1,1);FieldPut(2,"A")
DbAppend();FieldPut(1,2);FieldPut(2,"B")

COPY TO c:\dbf\target VIA "DBFCDX" // error XS9002: Parser: unexpected input '"DBFCDX"'
COPY TO c:\dbf\target FIELDS FLD1 FOR source->FLD1 > 1 // XSharp.Error: Value does not fall within the expected range.
COPY TO c:\dbf\target // XSharp.Error: Value does not fall within the expected range.

cpyrgas avatar Apr 29 '25 11:04 cpyrgas

Fixed a typo in dbcmd.xh which took care of most of the issues, but the VIA problem still remains. Looks like a preprocessor problem due to the various versions of COPY TO defined in the .xh file

COPY TO c:\dbf\target VIA "DBFCDX" // error XS9002: Parser: unexpected input '"DBFCDX"'

cpyrgas avatar Apr 29 '25 12:04 cpyrgas

Adjusted dbcmd.xh and FoxProCmd.xh to handle this.

RobertvanderHulst avatar Jun 12 '25 12:06 RobertvanderHulst

Robert, looks good, except for in the FoxPro dialect the VIA syntax results to "error XS9002: Parser: unexpected input 'TO'"

COPY TO c:\DBF\target VIA DBFCDX COPY TO c:\DBF\target VIA "DBFCDX"

Did you forget to push your changes to FoxProCmd.xh ?

cpyrgas avatar Jun 18 '25 09:06 cpyrgas

The FoxPro use command does not have a VIA clause. In FoxPro there are no RDDs

RobertvanderHulst avatar Jun 18 '25 11:06 RobertvanderHulst

Oops right! Confirmed fixed.

cpyrgas avatar Jun 18 '25 12:06 cpyrgas