Hello,
Pascal script. Any way to ask the scripter if a word is reserved?
Thanks,
Mark
Unfortunately not. But you can copy and paste from scripter source code itself.
Thank you.
break |
const |
continue |
downto |
exit |
unit |
uses |
BBCodes does a simple formatting.
function TLogicMain.IsWordReserved(const aWord: string): boolean;
const
reserved:array [0..37] of string = ('and','as','begin','break','case','const','continue',
'div','do','downto','end','except','exit','finally',
'for','forward','function','if','is','mod','not','or',
'procedure','program','repeat','shl','shr','step','then',
'to','try','unit','until','uses','var','while','with',
'xor');
var
i:integer;
lowered:string;
begin
result:=false;
lowered:=LowerCase(aWord);
for i:=0 to high(reserved) do
if (lowered = reserved [ i ] ) then
begin
Result := true;
Break;
end;
end;