home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
pas_nl
/
06
/
sequent.pas
< prev
Wrap
Pascal/Delphi Source File
|
1991-03-17
|
672b
|
23 lines
Function Sequential(look:integer):integer;{Sequential search}
{Look is the id you are looking for}
var
temp:integer; {Temporary number}
q:boolean; {Quit loop}
f:integer; {For loops}
Begin
sequential:=-1; {Temporary set to not found}
q:=false; {Set quit to no}
for f:=1 to count do begin
if a[f].id=look then begin
sequential:=a[f].inv;
q:=true;
end
else if a[f].id>look then begin
exit;
end;
if q=true then exit
end;
End;