More syntax highlighting woes

BlitzMax Forums/BlitzMax Programming/More syntax highlighting woes

ozak(Posted 2006) [#1]
Using the highlight function, the following test (If (Keywords[i] = test)) never validates.

Any idea why? (I know it's case sensitive ATM)


Global Keywords:String[] = ["Print","If", "Then", "Else"]

Function highlight:Int(test:String)

	For Local i:Int = 0 To Keywords.length-1				
	
		If (Keywords[i] = test)
			Return True
		End If

	Next
	
	Return False

End Function



Dreamora(Posted 2006) [#2]
You should save your keywords in lower case and test it this way

if (keywords[i] = test.tolower() )


otherwise you might run into case problems.


ozak(Posted 2006) [#3]
Yeah. Discovered that to seconds after posting. Thanks anyway :)