Can anyone point me in the right direction, with regards to syntax highlighting?
I have a text area, and I need to display each Xojo keyword in that text area, in the appropriate, default color (as in the IDE).
I have the list of Xojo keywords, but am unsure as to the correct approach to colorize any keywords which are found?
All pointers would be very much appreciated.
I have considered: if statements Select Case Dictionary Array
I was doing my own googling for the very same thing to try to enhance the CSS edit field in the newest version of Answers, but from what I understood all of those existing solutions (except for FTC) were outdated or didn’t work in the latest Xojo.
Did I misunderstand, are there updates, or could someone provide a little guidance?
I too, had already googled it, and all I can seem to find are outdated CustomEditFields??
I would prefer to use my current text area, and just run some kind of loop in order to colorize the keywords, but I do not know the best way to approach this - hence the request for directions
The project says it is using deprecated classes, so I looked at the actual code to see if I could understand what is happening.
Didn’t understand a word of it
I guess I will have to use a mammoth select case in order to check for keywords.
Thanks anyway Markus.
I thought this sounded like a fun project to play with. Here’s a simplified solution. (Surprisingly fast too)
It could likely use some better error checking, and I can’t get the first word to color correctly if there’s not a leading space… but feel free to mess with it.
The place where it gets hairy is trying to color comments, but NOT comments within quotes ie. “//”“this is not a comment”"", that’s where I left off… you could probably keep an array of quoted ranges and compare against that when looking for comments. hmm…