Board index » delphi » D2007: Sequence of Complex Extended Type Failure
Christopher Burke
![]() Delphi Developer |
D2007: Sequence of Complex Extended Type Failure2007-08-27 11:58:19 PM delphi32 I have a sequence of complex derived type, which produces the correct types and structures in Delphi - however the array in delphi is always created with 4 entries with all nil, irrespective of how many actually occur. THe following PHP shows the code for two of the functions I am serving: function doGetConversation($Reference) { $tow = new StdClass(); $t->Reference = $Reference; $t->Identity->Id = 1234; $t->Identity->Train = "TRAIN01"; $t->Identity->Client = 42; $t->Identity->Module = "BOB"; $t->MessageInfo[0]->Sender = "remote"; $t->MessageInfo[0]->TimeStamp = "2007-07-31T01:12:44.944Z"; $t->MessageInfo[0]->Progress = 1; $t->MessageInfo[0]->Position = 1; $t->MessageInfo[1]->Sender = "base"; $t->MessageInfo[1]->TimeStamp = "2007-07-31T01:12:44.944Z"; $t->MessageInfo[1]->Progress = 1; $t->MessageInfo[1]->Position = 1; $t->MessageText = "Free to move"; return($tow); } function doGetConversationList($Reference) { $t = new StdClass(); $t->Reference[0] = "AAAA12345678901234567890"; $t->Reference[1] = "BAAA12345678901234567891"; $t->Reference[2] = "CAAA12345678901234567892"; $t->Reference[3] = "DAAA12345678901234567893"; return($t); } The following calls: P:=GetMessagePort; RL:=P.doGetConversationList('ABC'); M:=P.doGetConversation(R); Memo1.Lines.Add(R); Memo1.Lines.Add(RL[0]); Memo1.Lines.Add(RL[1]); Memo1.Lines.Add(RL[2]); Memo1.Lines.Add(RL[3]); Memo1.Lines.Add(M.MessageText); Memo1.Lines.Add(M.Identity.Train); Memo1.Lines.Add(inttostr(low(M.MessageInfo))); Memo1.Lines.Add(inttostr(high(M.MessageInfo))); Memo1.Lines.Add(inttostr(M.MessageInfo[0].Progress)); Memo1.Lines.Add(inttostr(M.MessageInfo[0].Position)); Memo1.Lines.Add(M.MessageInfo[0].TimeStamp.NativeToXS); Produce: Memo1 AAAA12345678901234567890 AAAA12345678901234567890 BAAA12345678901234567891 CAAA12345678901234567892 DAAA12345678901234567893 Move 100km TRAIN01 0 3 0 0 <---- AV error Debug shows M.MessageInfo is (([], nil, remote, nil, 0, 0), ([], nil, remote, nil, 0, 0), ([], nil, remote, nil, 0, 0), ([], nil, remote, nil, 0, 0)) It should return two elements. Any help would be appreciated. Thanks. |