Try this. Reading should be the same... (but backwards)
 
type
  DataLocations  = record
    Data  : array[1..6] of byte;
  end;
 
var
  ProgramData  :  array[1..200] of DataLocations;
  MyField: TBlobField ; // This is of course defined in the table, not here
 
procedure TForm1.Button1Click(Sender: TObject);
var
  bs: TBlobstream ;
  x, y: integer ;
 
begin
  bs := TBlobStream.Create(MyField, bmReadWrite) ;
  for x := 1 to 200 do
    for y := 1 to 6 do
      bs.write(ProgramData[x].Data[y], 1) ;
  bs.free ;
end;
 
Dave.
 -----Original Message-----
From: Colin R Dillicar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 7 June 2000 7:27 p.m.
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Streaming Data to/from BLOBs

 
Despite a few replies to my earlier request for help I am still none the wiser. Most replies have steered me to the Help topics which mostly deal with Memo fields , certainly in respect of examples. If I understood exactly what was going on I wouldn't have asked and would not be embarrassed by asking again. I am embarrassed, I am probably rather dim - OK !
 
I am having difficulty passing information between a BLOB field in a database and an array in memory and would appreciate it if someone familiar with the process would provide me with some sample code.
 
The array I have is "Program Data", as follows :-
 
type
       DataLocations  = record
          Data  : array[1..6] of byte;
      end;
 
var
      ProgramData  :  array 1..200 of DataLocations;
 
 
Even ignoring the above record definition, I have approximately 1024 bytes of data that I want to pass back and forth between memory and  one of a number of Numeric (BLOB) fields in Paradox table. What I need is a clip of code that does that sort of thing with a brief explanation of what's going on. I'm sure that from then on I'll grasp the method.
 
Any help would be greatfully appreciated.
 
TIA
 
     Colin
 
 

Reply via email to