Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TFDDATSSET GetData convert pointer value to dynamic array


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0 Threads: [ Previous | Next ]
Mark Williams

Posts: 120
Registered: 5/8/10
TFDDATSSET GetData convert pointer value to dynamic array  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 5, 2018 5:26 AM
I have posted this question on Delphi Language forum, but I sspect that is the wrong place. I think my problem stems from a lack of understanding of the parameters for the GetData function.

I can save a dynamic integer array to a blobfield using TBlobField LoadFromStream. I save the length of the dynamic array as a separate field. I can also load it from a TBlobField using SaveToStream. However, at certain points I wish to access the blob data without updating the RecNo. To do that I believe I have to use GetData. My (failing) code so far is:

  with FDQuery1 do begin
          setLength(MyIntArray, Integer(Table.Rows[table.Rows.Count-1].GetData(2)));  //this is the database column which stores the number of items in the array         
          Len2 := Length(MyIntArray) * sizeOf(Integer);
          if Table.Rows[table.Rows.Count-1].GetData(1, rvDefault, Pointer(MyIntArray), Len, Len2, true) then begin
             for i := 0 to  High(MyIntArray) do
                s := s + MyIntArray[i].ToString + ', ';
          Showmessage(s);          


I have tried setting ABuffLen to the value of Len2. I have also tried setting it to SizeOf(Integer) with ADataLen set to the length of the array and so on with every possible combination I can think of! Neither really seem to affect the outcome, but that may be because of the way I am trying to handle the array after. The result of my showmessage is always something like "122060280, 0, 0, 0, 0," (and so on for 101 items).

I can't find any documentation on the GetData function
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02