James,
I noticed your post on the JRS forum and wondered why a simple INSTR() function wasn't used?
pbkeywords = """
"IF","THEN","ELSE","TRY","CATCH","END","SELECT","CASE","FUNCTION","SUB","ITERATE","FOR","NEXT","WHILE","UNTIL","DO","LOOP","WEND","STEP"
"EXIT","REGISTER","LOCAL","GLOBAL","STATIC","INCR","DECR","BY","DATA","OPT","OPTIONAL","CONST","SLEEP","RESOURCE","OBJECT","IMAGE","SWAP"
"AS","TO","GOTO","STDOUT","PRINT","PRINTR","PRINTBR","ECHO","DIM","REDIM","BYVAL","BYREF","BYCOPY","TYPE","TABLE","ENTRY","LANGUAGE","NAME"
"MACRO","EXPORT","REPLACE","WITH","IN","GOSUB","RETURN","ENDIF","MACROTEMP","ELSEIF","YES","NO","ON","OFF","REGISTER","SYSTEM","ARR","INFINITE"
"ASCEND","DESCEND","TAGARRAY","COLLATE","FROM","SCAN","INSERT","DELETE","VARIANT","TCP","PORT","AT","SEND","RECV","TIMEOUT","ALIAS","LIB"
"DECLARE","DEF","ERRORS","PLURIBASIC","WARNINGS","NOTICES","DEPRECATED","PARSES","ALL","NONE","ANY","EXACT","ITERATE","PHP","HTML","START"
"MYSQL","LOAD","SAVE","DELETE","WHERE","LIMITUDT","PBCC","PBWIN","USEUNICODE","CRACKERS","SESSTART","EXCLUSIVE","AUTO","OPEN","CLOSE","CLOSED"
"APPEND","INPUT","OUTPUT","SETEOF","SEEK","GET","PUT","PRINT","FOREACH","ACCESS","READ","WRITE","SHARED","LOCK","SEEK","LINE","CALL","BITWISE"
"LOGICAL","UDT","QUIT","ABORT","TERMINATE","DECLARE","CLASS","METHOD","PROPERTY","CREATE","DESTROY","INSTANCE","GET","SET","INTERFACE","LET"
"CREATE","DESTROY","WAITKEY$","RESET","RESERVE","DEFBYT","DEFDWD","DEFINT","DEFLNG","DEFSNG","DEFSTR","DEFWRD","DEFASC","BINARY"
"ISCOND","NOTNULL","AUTOINC","PRIMARY","ON","OFF","YES","NO","EXE","PHP","DLL","SLL","CONSOLE","EXCLUDE","INCLUDE","RAW"
"VARPTR","LBOUND","UBOUND", "SYS_ARR","SYS_IMG"
"IIF","CHOOSE","CHOOSES","CHOOSEI","CHOOSED","CHOOSEF","CHOOSEB", "USING","EOD"
"""
OPTION COMPARE sbCaseInsensitive
testcase = "WaitKey$"
IF INSTR(pbkeywords, "\"" & testcase & "\"") THEN
PRINT TRUE,"\n"
ELSE
PRINT FALSE,"\n"
END IF
jrs@jrs-laptop:~/sb/examples/test$ time scriba pbkw.sb
-1
real 0m0.005s
user 0m0.004s
sys 0m0.004s