Add new element to an array
Posted: Wed Dec 10, 2014 4:33 pm
Hi,
I am attempting to manipulate data stored in a datagrid by accessing the dgdata property. I wish to add a new column/field/element to the data which already has some twenty odd fields. I do this inside a loop that is looping through the numeric keys of an array populated by reading dgdata. My first attempt : This does add a new element named 'TheNewElement' but it deletes all of the other elements and becomes the only data. My work around is to read the record into a new record array e.g. this works but the original column order is lost.
Is there another way of adding an element/column to an array for display in a datagrid that preserves the original column order?
best wishes
Simon
I am attempting to manipulate data stored in a datagrid by accessing the dgdata property. I wish to add a new column/field/element to the data which already has some twenty odd fields. I do this inside a loop that is looping through the numeric keys of an array populated by reading dgdata. My first attempt :
Code: Select all
put "Some data" into tDataA[25]["TheNewElement"]
Code: Select all
put tDataA[25] into tRecordA
put "SomeData" into tRecordA["TheNewElement"]
put tRecordA into tDataA[25]
Is there another way of adding an element/column to an array for display in a datagrid that preserves the original column order?
best wishes
Simon