home *** CD-ROM | disk | FTP | other *** search
- 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;
-