user1023395
user1023395

Reputation: 263

Get Variable Value from Web

loaded text from web which is like value1=1,value2=2,value3=3 bla bla bla

I actually wanted to get value for declared variables is it possible ?

//loaded from web address 
value1=1,value2=2,value3=3

Procedure getvarvaules;
var
value1:string  ='1';
value2:string  ='2';
value3:string  ='3';
begin
end;

Upvotes: 3

Views: 234

Answers (1)

Uwe Raabe
Uwe Raabe

Reputation: 47704

Use a TStringList:

var
  lst: TStringList;
begin
  lst := TStringList.Create;
  try
    lst.Commatext := { variable containing the webresult };
    value1 := lst.Values['value1'];
    value2 := lst.Values['value2'];
    value3 := lst.Values['value3'];
  finally
    lst.Free;
  end;
end;

Upvotes: 4

Related Questions