Jay1b Posted March 17, 2004 Posted March 17, 2004 I am trying to write a program that does the following. -Colour in key words blue, such as IF and ENDIF. -Draw vertical lines on the text matching up each IF and ENDIF. These vertical lines should be drawn automatically, and should stay in place when the user scrolls. ie: IF 1 = 1 THEN | message 'Durr'; | i = i + 1; | etc.......... ENDIF; This formatting shouldnt be saved into the textfile, but should be drawn on top of it afterwards. Firstly, am i talking sense? Secondly - If above = true, then could someone point me in the right direction? Thanks Quote
*Experts* mutant Posted March 17, 2004 *Experts* Posted March 17, 2004 Syntax coloring is not hard to implement using Regular Expressions. You only have two keywords so it shuldn't be a problem. For your vetical lines, if you wish to use this character: | then searching for THEN and NewLine might do what you want, you can for example replace it with THEN, NewLine and |. Quote
Jay1b Posted March 17, 2004 Author Posted March 17, 2004 i dont want that character, i was just using it as an example. I dont want any character, just a line to be drawn on top of the code. Sometimes i have to edit code, which can have 5/6 embedded if statements, some times whilst editing this code i print it out and manually drawn lines between the indentation of the IF/while/loop statements - to show which ones join up with which. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.