Harry
2011-03-03 00:09:53
I am no expert with this or anything, but I am pretty sure try/except case will stop R_GetUpText from giving out of range errors. It compiled fine and ran fine for 4 hours without issues (albeit the issue not happening frequently to begin with, but frequently enough to be annoying), and I hope it stays that way.
Try it out:
Might be a good commit if it runs well for you – seems to fix the issue for me.
Try it out:
function R_GetUpText: string;
var
MenuOptions: TStringArray;
First: String;
begin
MenuOptions := GetMenuText;
try
First := Trim(MenuOptions[0]);
Result := First;
if (Length(MenuOptions) > 1) and (Result <> '') then
Result := Result+' / '+inttostr(Length(MenuOptions))+' more options';
except
WriteLn('R_GetUptext failed!');
Result := '';
end;
end;Might be a good commit if it runs well for you – seems to fix the issue for me.