SetAt
Description
Sets a value or string to the array item at the specified
dimension.
Syntax
For arrays of a specified ValueType:
|
1 |
SetAt(pblong dim[], ValueType v) |
For string arrays:
|
1 2 |
SetAt(pblong dim[], LPCTSTR string) SetAt(pblong dim[], pbstring string) |
|
Argument |
Description |
|---|---|
|
dim |
The dimension of the array item to be |
|
v |
A ValueType defined in pbtraits.h |
|
string |
A string of type pbstring or LPCTSTR |
Return value
None.
Examples
This example shows the use of SetAt in arrays of a type specified
by a ValueType:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
// arguments: // ac: class object of PBBoundedArrayCreator or // PBBoundedObjectArrayCreator to set items into // dimensions: array dimension, can be 1,2,3,...,n // bounds: upper and lower bound for each dimension // iarg: T type array to store the data value set // into array creator ac // current_dim: remember which dimension is looped into template < typename T, pbvalue_type I,class C> void BoundedArrayItem<T,I,C>::f_set_arrayitem (IPB_Session* session, C& ac, pblong dimensions, arrayBounds* bounds, T* iarg, int current_dim) { int i; if (current_dim > dimensions) return; for(i= bounds[current_dim-1].lowerBound; i<= bounds[current_dim-1].upperBound; i++) { if (current_dim == dimensions) { dim[current_dim-1]= i; ac.SetAt(dim,iarg[array_itemcount]); array_itemcount++; } else { dim[current_dim-1]= i; BoundedArrayItem<T,I,C>::f_set_arrayitem (session, ac, dimensions, bounds, iarg, current_dim+1); } } } |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest