Im sorry.
SCAR Code:
var
frmDesign : TForm;
GroupBox1 : TGroupBox;
RadioButton: array [0..2] of TRadioButton;
Memo1 : TMemo;
Button1 : TButton;
function GetFact(site, s1, s2: string): string;
var a: string;
begin
a:= getpage(site);
result:= TrimEx(' ', between(s1, s2, a));
end;
procedure StartClick(sender: TObject);
begin
if RadioButton[0].Checked then
Memo1.Text:= GetFact('http://4q.cc/index.php?pid=fact&person=chuck', '<div id="factbox">', '</div>');
if RadioButton[1].Checked then
Memo1.Text:= GetFact('http://4q.cc/index.php?pid=fact&person=mrt', '<div id="factbox">', '</div>');
if RadioButton[2].Checked then
Memo1.Text:= GetFact('http://www.randomfunfacts.com/',
'<td bordercolor="#FFFFFF"><font face="Verdana" size="4"><strong><i>', '</i></strong></font>');
end;
procedure Initform;
var
i: Integer;
a: Tstringarray;
begin
frmDesign := CreateForm;
with frmDesign do
begin
Position := poScreenCenter;
BorderStyle := bsSingle;
BorderIcons := [biMinimize,biSystemMenu];
Width := 365;
Height := 183;
Caption := 'Akwardsaw'#39's Fact Generator';
end;
GroupBox1 := TGroupBox.Create(frmDesign);
with GroupBox1 do
begin
Parent := frmDesign;
SetBounds(8,8,97,89);
Caption := 'What Fact?';
end;
a:= ['Chuck Norris', 'Mr. T','Random'];
for i := 0 to high(radiobutton) do
begin
RadioButton[i] := TRadioButton.Create(GroupBox1);
with RadioButton[i] do
begin
Parent := GroupBox1;
SetBounds(8,16 + i*(24),113,17);
Caption := a[i];
end;
end;
Memo1 := TMemo.Create(frmDesign);
with Memo1 do
begin
Parent := frmDesign;
SetBounds(112,16,225,81);
lines.Add('');
ScrollBars := ssVertical;
end;
Button1 := TButton.Create(frmDesign);
with Button1 do
begin
Parent := frmDesign;
SetBounds(96,112,73,25);
Caption := 'Generate';
Button1.OnClick := @StartClick;
end;
end;
procedure SafeInitform;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('Initform', v);
end;
procedure ShowInitformModal;
begin
frmDesign.ShowModal;
end;
procedure SafeShowInitformModal;
var
v : TVariantArray;
begin
SetArrayLength(v, 0);
ThreadSafeCall('ShowInitformModal', v);
end;
procedure MainInitform;
begin
try
SafeInitform;
SafeShowInitformModal;
finally
FreeForm(frmDesign);
except
WriteLn('An error seems to have occurred in: Initform');
end;
end;
begin
ClearDebug;
MainInitform;
end.