Log in

View Full Version : Why Doesn't This Compile?



John
05-12-2012, 02:27 AM
That's one of my functions and it won't compile keep getting:
[Error] (348:37): Type mismatch at line 347

With This Line HighLighted:
if OptionsExist('nteract', False) then

Function CheckFamiliar: boolean;
begin
MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
if OptionsExist('nteract', False) then
begin
Result:= True
WriteLn('We Still have our Graahk');
end else
begin
Result:= False
WriteLn('We Need A New Graahk');
end;
end;

I can't post full script since it's a Nature RuneCrafter.

All help Appreciated :)

Sex
05-12-2012, 02:33 AM
The name of the function is OptionsExist which leads me to believe it accepts a TStringArray instead of just a string. So try
OptionsExist(['nteract'], False)?

Edit: You could shorten the function too:
function CheckFamiliar : boolean;
begin
MouseBox(700, 136, 714, 148, MOUSE_RIGHT);
result := OptionsExist(['nteract'], False);
if result then
Writeln('We still have our Graahk')
else
Writeln('We need a new Graahk');
end;

John
05-12-2012, 03:02 AM
Sex saves the day again :D
Hehe