For Programmers: Free Programming Magazines  


Home > Archive > Clipper > June 2006 > How to pass an array of fieldnames to Clipper COPY TO NewTable FIELDS....









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to pass an array of fieldnames to Clipper COPY TO NewTable FIELDS....
E. Fridman

2006-06-17, 7:55 am

Richard,

<<< > Does anyone know how to pass an array to the Clipper COPY TO
command >>>

Have you tried to create a comma-separated concatenated string and then
macro-expand it?

HTH, Eugene

ClipperSolutions

2006-06-17, 7:55 am

Does anyone know how to pass an array to the Clipper COPY TO command

example: Instead of COPY TO (cNewTable) FIELDS ACCT, NAME, ADDRESS

aInfo:={"ACCT", "NAME", "ADDRESS"}
COPY TO (cNewTable) ..... populate the fields with the array

Creating a table using the structure of the fields, openning that table
and appending from the
source table will only work if the source table is open in shared mode
using the source alias
or if the source table is closed and a table path is passed.

I am trying to emulate XBase++ dbexport()

Richard

ClipperSolutions

2006-06-17, 9:55 pm


E. Fridman wrote:
> Richard,
>
> <<< > Does anyone know how to pass an array to the Clipper COPY TO
> command >>>
>
> Have you tried to create a comma-separated concatenated string and then
> macro-expand it?
>
> HTH, Eugene



Yes, tried concatenating array elements and macro expanding.
Each element has to be separate such as &a[1], &a[2], &a[3] but a
single string
will not work no matter how the elements are concatenated.

Kevin

2006-06-18, 7:55 am


ClipperSolutions wrote:
> Does anyone know how to pass an array to the Clipper COPY TO command
>
> example: Instead of COPY TO (cNewTable) FIELDS ACCT, NAME, ADDRESS
>
> aInfo:={"ACCT", "NAME", "ADDRESS"}
> COPY TO (cNewTable) ..... populate the fields with the array


__dbCopy(cNewTable, aInfo)

See STD.CH.

Kevin

ClipperSolutions

2006-06-19, 6:55 pm

Thank you Kevin,

You reminded me that procedures get translated into functions by the
preprocessor.
__dbcopy accepts fields on an array.

ClipperSolutions (Richard)

Kevin wrote:
> ClipperSolutions wrote:
>
> __dbCopy(cNewTable, aInfo)
>
> See STD.CH.
>
> Kevin


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com