Ignore:
Timestamp:
Oct 20, 2009, 11:31:33 AM (15 years ago)
Author:
george
Message:
  • Fixed: Handling repeated fileds.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ProtocolBuffers/UMainForm.pas

    r11 r12  
    9494        Tag := 2;
    9595        ItemType := itString;
    96         ItemMode := imOptional;
     96        ItemMode := imRepeated;
    9797      end;
    9898      Items.Add(NewItem);
     
    128128    TPBStringItem(TPBMessageItem(PB.BaseMessage.Items[3]).
    129129      Items[0]).Value := 'Vsetínská';
     130//    TPBStringItem(PB.BaseMessage.Items[1]).Value := 'Abc';
     131    with TPBRepeatedItem(PB.BaseMessage.Items[1]) do begin
     132      Items.Add(nil);
     133      Items.Add(nil);
     134      Clear(TPBDefinition(Definition.Items[1]));
     135      TPBStringItem(Items[0]).Value := 'Test';
     136      TPBStringItem(Items[1]).Value := 'Hops';
     137    end;
     138
    130139    DisplayTree(PB, TreeView1);
    131140    SaveToStream(Stream);
     
    154163        Tag := 2;
    155164        ItemType := itString;
     165        //ItemMode := imRepeated;
    156166        DefaultString := 'Billy Joe';
    157167      end;
     
    227237  NewNode: TTreeNode;
    228238begin
    229   for I := 0 to Definition.Items.Count - 1 do
    230   with TPBDefinition(Definition) do begin
     239  for I := 0 to PBRepeated.Items.Count - 1 do
     240  with Definition do begin
    231241    NewNode := Node.Owner.AddChild(Node, '');
    232242    if ItemType = itString then begin
Note: See TracChangeset for help on using the changeset viewer.