• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 

Create nrDataprocessor without visual component

Started by Arne, July 12, 2012, 03:58:13 am

Previous topic - Next topic

Arne

Hello,
I usually drag&drop TnrComm and TnrDataProcessor objects onto my form and create enough data-packets via the object inspector.
Now I need to do this in a TTHread class that has no form.
So I do:

nrComm := TnrComm.Create(nil);
nrDataProcessor := TnrDataProcessor.Create(nil);
nrComm.DataProcessor := nrDataProcessor;


Now I want to create enough space for the data-packets.
How shall I do this. I'm a bit puzzled with TCollection, TCollectionItem and so on.

nrDataPacket := TnrDataPacket.Create(???);


What I usually do when I can use drag&drop for the TnrDataProcessor is something like:

nrDataProcessor.DataPackets[0].Caption       := 'Login';
nrDataProcessor.DataPackets[0].PacketBegin   := #$3A + #$00;
nrDataProcessor.DataPackets[0].PacketLength  := 5;
nrDataProcessor.DataPackets[0].Active        := True;


bye, Arne

Roman Novgorodov

Hello

Hmmm .... you can try something like following:


  with nrDataProcessor1.DataPackets.Add do begin
      PacketBegin := 'Zzzz';
      PacketLength := 22;
      Active := true;
  end;



Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.