Здравствуйте. Не подскажите ли вы мне, существуют ли какие нибудь методы возвращения нескольких параметров из функции? Пытался вернуть массив, delphi 2010 ругается ((
| Код | type TArInt=array of string;
....
function Tform1.query1(url, action, key, id:string):TArInt; var arr : Array of string; xml1,res, name, surname, pat, bonus, reg, last, birth:string; n:integer; begin res := IdHTTP1.get(url+'action='+action+'&session_key=' + key + '&id='+id); arr[0]:=balance; n := Pos('<name>', res); xml1 := Copy(res, n + 6, length(res)); n := Pos('</name>', xml1); name:=Copy(xml1, 1, n - 1); ShowMessage(name); arr[1]:=name; n := Pos('<surname>', res); xml1 := Copy(res, n + 9, length(res)); n := Pos('</surname>', xml1); surname:=Copy(xml1, 1, n - 1); arr[2]:=surname; n := Pos('<patronymic>', res); xml1 := Copy(res, n + 12, length(res)); n := Pos('</patronymic>', xml1); pat:=Copy(xml1, 1, n - 1); arr[3]:=pat; n := Pos('<bonus>', res); xml1 := Copy(res, n + 7, length(res)); n := Pos('</bonus>', xml1); bonus:=Copy(xml1, 1, n - 1); arr[4]:=bonus; n := Pos('<lastdate>', res); xml1 := Copy(res, n + 10, length(res)); n := Pos('</lastdate>', xml1); last:=Copy(xml1, 1, n - 1); arr[5]:=last; n := Pos('<regdate>', res); xml1 := Copy(res, n + 9, length(res)); n := Pos('</regdate>', xml1); reg:=Copy(xml1, 1, n - 1); arr[6]:=reg; n := Pos('<birth>', res); xml1 := Copy(res, n + 7, length(res)); n := Pos('</birth>', xml1); birth:=Copy(xml1, 1, n - 1); arr[7]:=birth; end;
|
|