Author Topic: Create nrDataprocessor without visual component  (Read 1481 times)


  • Newbie
  • *
  • Posts: 15
    • View Profile
Create nrDataprocessor without visual component
« on: July 12, 2012, 06:58:13 am »
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:
Code: [Select]
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.
Code: [Select]
nrDataPacket := TnrDataPacket.Create(???);

What I usually do when I can use drag&drop for the TnrDataProcessor is something like:
Code: [Select]
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

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1016
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Create nrDataprocessor without visual component
« Reply #1 on: July 31, 2012, 05:46:01 am »

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

Code: [Select]
  with nrDataProcessor1.DataPackets.Add do begin
      PacketBegin := 'Zzzz';
      PacketLength := 22;
      Active := true;

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.