Page 1 of 1
APPEND with for
Posted: Wed Jun 26, 2024 11:47 am
by COMSYSplus
Hi everyone,
we just try to convert your VFP 9.0 software applications zu x#.
We get some problems with "APPEND for". The "for" clauses appends less data then our VFP code ( which works well )
Is something different in x#, have we to set something ?
Thank you very much for helping.
Peter
Re: APPEND with for
Posted: Wed Jun 26, 2024 5:30 pm
by robert
Peter
Can you post a sample of the code and data?
Robert
Re: APPEND with for
Posted: Thu Jun 27, 2024 3:32 pm
by COMSYSplus
Robert,
we did it with following Code:
XSharp:
COPY FILE "Zwischen\f_artike_kopie.DBF" to "Zwischen\005_f_artike_use.dbf"
COPY FILE "Zwischen\f_artike_kopie.FPT" to "Zwischen\005_f_artike_use.fpt"
COPY FILE "Zwischen\f_artike_kopie.CDX" to "Zwischen\005_f_artike_use.cdx"
select 0
use "Zwischen\005_f_artike_use" alias artikel exclusive
delete all for recno() > 0
pack
use
select 0
use "Zwischen\005_f_artike_use" alias artikel
append from "Zwischen\f_artike_kopie" for ALLTRIM(Artiknr) < "2000"
=========================================================================================
VFP:
COPY FILE "Zwischen\f_artike_kopie.DBF" to "Zwischen\005_f_artike_use.dbf"
COPY FILE "Zwischen\f_artike_kopie.FPT" to "Zwischen\005_f_artike_use.fpt"
COPY FILE "Zwischen\f_artike_kopie.CDX" to "Zwischen\005_f_artike_use.cdx"
select 0
use "Zwischen\005_f_artike_use" alias artikel exclusive
Zap
use
select 0
use "Zwischen\005_f_artike_use" alias artikel
append from "Zwischen\f_artike_kopie" for ALLTRIM(Artiknr) < "2000"
=========================================================================================
The result is:
XSharp: ==> Datensätze nach append for: 16 <==
VFP: ==> Datensätze nach Append for: 37 <==
I attach the tables which we are using als zip-file.
Peter
Re: APPEND with for
Posted: Wed Jul 03, 2024 2:53 pm
by robert
Peter,
There is an error in the UDC.
If you add this to the top of your file, then it should work:
Code: Select all
#command APPEND [FROM <(file)> ] ;
[__FOXLIST__ <fldlist>] ;
[__FOXWILD__ <fldwild> ] ;
[FOR <lfor>] ;
[WHILE <lwhile>] ;
[NEXT <nNext>] ;
[RECORD <rec>] ;
[<rest:REST>] ;
[ALL] ;
[TYPE] [<type: FOXPLUS,FOX2X,DIF,MOD,SDF,SYLK,WK1,WKS,WR1,WRK,CSV,XLS,XL5,XL8 >] ;
[SHEET <sheet>] ;
[AS <nCodePage>] ;
;
=> DbAppFox( ;
<(file)>, iif( <.type.>,#<type>,"DBF"), ;
iif( <.fldlist.>, <!fldlist!>, <!fldwild!>), ;
<{lfor}>, <{lwhile}>, <nNext>, ;
<rec>, <.rest.> , ;
<(sheet)>, <nCodePage> ;
)
Btw we do not support all the types in the command yet.
Supported are:
- standard dbf (no type clause)
- foxplus
- fox2x
- csv
- sdf
Robert