I have a field and a button. I want to allow user to input something in the field then click on the button, then the program will decide whether the string entered in the field is a keyword in runrev. Anybody know how to do this??
[/code]
check reserved word
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
Look for "names" in the dictionary part of the docs. For instance,
the commandNames
commandNames()
Returns a list of all built-in commands in Transcript.
the constantNames
constantNames()
Returns a list of all built-in constants in Transcript.
the propertyNames
propertyNames()
Returns a list of all built-in properties in Transcript.
the functionNames
functionNames()
Returns a list of all built-in functions in Transcript.
To use them, simply write:
the commandNames
commandNames()
Returns a list of all built-in commands in Transcript.
the constantNames
constantNames()
Returns a list of all built-in constants in Transcript.
the propertyNames
propertyNames()
Returns a list of all built-in properties in Transcript.
the functionNames
functionNames()
Returns a list of all built-in functions in Transcript.
To use them, simply write:
Code: Select all
on mouseup
put the text of field "myfield" into tString
if isReservedWord(tString) is true then
......
end if
end mouseup
function isReservedWord pString
if pString is among the lines of the commandnames then return true
if pString is among the lines of the constantnames then return true
if pString is among the lines of the functionnames then return true
if pString is among the lines of the propertynames then return true
return false
end isReservedWord