Passing an array to SetField

Passing an array to SetField

Post by Bruce Swar » Sun, 31 Dec 1899 09:00:00



How can I "construct" an array to be passed to Dataset.Setfields ?
Something like this:

--
while fields do
 add field value to array

setfields(array)
--
Any ideas?
--

 
 
 

Passing an array to SetField

Post by Ken Whit » Sun, 31 Dec 1899 09:00:00


Bruce,

Wrong type array - SetFields uses an array of const, not an actual
array.

Your call to SetFields would look something like this:

    SetFields([Value1, Value2, Value3]);

Notice the square brackets surrounding the list of values? This
syntax creates the 'array of const'.

HTH

Ken
--
Ken White

Clipper Functions for Delphi
http://members.aol.com/clipfunc/


> How can I "construct" an array to be passed to Dataset.Setfields ?
> Something like this:

> --
> while fields do
>  add field value to array

> setfields(array)
> --
> Any ideas?
> --



 
 
 

1. Setting SetField values via an array??

How is it possible to pass an array of values to the
"SetFields" method for TDAtaSet?  I want to specify a
set of values for a table (whose number of fields may
vary) - using string arrays does not work & the compiler
gives an error trying to define an "array of const" unless
I use hardcoded values (which I do not want do as these
vary at runtime...)

procedure SetFields(const Values: array of const);

Thanks
Derek
--

variables are irrelevant. functions are useless.
prepare to be encapsulated...

2. Virtual segments

3. How to pass an integer array/userdef type array into an Oracle Stored procedure

4. IDMS Visual Objects

5. Stupid setfield question

6. SQL*Server - SP2 instal affecting ASP pages

7. SetField and repetition fields

8. problem using DTS

9. How to pass an array to store procedure

10. Passing an Array to a stored proc

11. Passing data in a Dynamic Array to a Stored Procedure

12. Can I pass arrays to SQL Server sprocs?

13. passing array into INSERT stored proc