Hello,
I am playing around with Benibella's Internet tools to retrieve data from a web form. In order to learn how to use it, I started with a simple HTML I made and the the source code I apply. Somehow though it gives me a SIGSEGV error when I try to use another template, other than the one pointing to the first element on the page.
const
EXAMPLE_TEMPLATE :string='<table name="tabdata"><tr><td>{.}</td><td>{.}</td></tr>*</table>';
temp1:string='<input name=e1>{e1:=@value}</input>';
temp2:string='<input name=e2>{e2:=@value}</input>';
var
Form1: TForm1;
content:string;
m:integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.retrieveDataClick(Sender: TObject);
begin
m:=strtointdef(indexOfItem.Text,0);
content:=retrieve(address.Text);
case m of
0:process(content, temp1);
1:process(content, temp2);
2:process(content, EXAMPLE_TEMPLATE);
3:process(content, EXAMPLE_TEMPLATE);
end;
responseEdit.Text:=processedVariables.get(m).toString;
content:='';
processedVariables.Free;
end;
This is the index.html against which I am testing it.
<!doctype html>
<html>
<title>Untitled Page</title>
<body>
<input name=e1 value="300"></input>
<input name=e2 value="500"></input>
<table name=tabdata>
<tr><td>20</td><td>30</td></tr>
</body>
</html>
It only works for the first template, in other words for the first input box in the web page. For any other index it gives me SIGSEGV. What am I doing wrong? Am I trying to overstep the possibilities which Internet Tools offer?