Hi, I was wondering how to get the data out of this procedure without freezing so that I can display it on a memo of in a edit field. Also is it possible to make a edit field display some text and then a string variable at the same time?
Heres the procedure
procedure TForm1.SearchClick(Sender: TObject);
var
I,Position,number : Integer;
Astring,BString:string;
A:boolean;
begin
number := StrToInt(input.Text);
I:=0;
Position:=0;
number:=0;
For I:= 0 to MaxNumbers do
begin
Repeat
IF A=false Then Begin
Num := number;
Position := I;
end
Until A=true;
end;
BString:= INTTOSTR(Position);
IF A=true then
sortedmemo.lines.add(Bstring)
Else
sortedmemo.lines.add('Number not Found');
end;
This code will compile but it just causes the comp to freeze... Its supposed to look in the array for 'Number' and if it finds it display where it found it in the array and if it deosnt a not found message.
Thanx for your help
Heres the procedure
procedure TForm1.SearchClick(Sender: TObject);
var
I,Position,number : Integer;
Astring,BString:string;
A:boolean;
begin
number := StrToInt(input.Text);
I:=0;
Position:=0;
number:=0;
For I:= 0 to MaxNumbers do
begin
Repeat
IF A=false Then Begin
Num := number;
Position := I;
end
Until A=true;
end;
BString:= INTTOSTR(Position);
IF A=true then
sortedmemo.lines.add(Bstring)
Else
sortedmemo.lines.add('Number not Found');
end;
This code will compile but it just causes the comp to freeze... Its supposed to look in the array for 'Number' and if it finds it display where it found it in the array and if it deosnt a not found message.
Thanx for your help