RTC Forums

Subscription => Support => Topic started by: classic12 on November 24, 2011, 11:18:11 PM



Title: Using an array
Post by: classic12 on November 24, 2011, 11:18:11 PM
I am using the following in an IOS app:

procedure TForm2.Image7Click(Sender: TObject);
  var
  QueryType : String;
  BS: TMemoryStream;
  _Item : TListBoxItem;
  rowcount , i : Integer;
 // StrArray: Array[];
  StrArray : TRtcArray;
  begin


// test ot send to server 'something'
  rowcount := ListBox1.Items.Count;
  with UticketEntry.FormTicketEntry.RtcClientModule1 do
    begin


        SetLength(StrArray, ListBox1.Items.Count);
          for I := 0 to ListBox1.Items.Count - 1 do
            begin
                _Item := ListBox1.ItemByIndex(i);
                StrArray:= _Item.Binding['desc1'];
            end;

      Prepare('DataFromClient');
      Param.asArray['name']:= StrArray;
      Call(UticketEntry.FormTicketEntry.RtcResult1);
    end;
  end;
but I am getting.
[DCC Error] UForm2.pas(504): E2003 Undeclared identifier: 'TRtcArray'


Title: Re: Using an array
Post by: D.Tkalcec (RTC) on November 25, 2011, 02:08:22 AM
Code:
uses 
  rtcInfo;
...
procedure TForm2.Image7Click(Sender: TObject);
  var
    _Item : TListBoxItem;
    I : Integer;
    StrArray : TRtcArray;
  begin
  with UticketEntry.FormTicketEntry do
    begin
    RtcClientModule1.Prepare('DataFromClient');
    StrArray := RtcClientModule1.Param.newArray('name');
    for I := 0 to ListBox1.Items.Count - 1 do
      begin
      _Item := ListBox1.ItemByIndex(i);
      StrArray.asText[I] := _Item.Binding['desc1'];
      end;
    Call(RtcResult1);
    end;
  end;