mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 13:28:05 +02:00
17 lines
284 B
ObjectPascal
17 lines
284 B
ObjectPascal
{ %OPT=-Ooloopunroll -O2 -S2 -Cr }
|
|
const
|
|
StrArray :array[0..1] of string = ('s1','s2');
|
|
|
|
function FindStr(const s :string) :Integer;
|
|
var
|
|
i :Integer;
|
|
begin
|
|
for i := High(StrArray) downto 0 do
|
|
if StrArray[i] = s then Exit(i);
|
|
Result := -1;
|
|
end;
|
|
|
|
begin
|
|
FindStr('s1');
|
|
end.
|