Check syntax in Richtextbox
Dear All,
I want to check for Syntax with Richtextbox.That it should search for opening of a tag like "'{" and ending for the "}",(if some thing selected it should search for within the selection, else full content).
same.If any ending or starting tag is missing tag has to higlighted..How to do that.
# 1 Re: Check syntax in Richtextbox
instr(first_position, selected_text, "{")
and
instr(first_position, selected_text, "}")
if both are not zero then that's ok otherwise , the one which returns zero is missing ...
higlighte the tag by the member .selstart and .selend when assigning to them first_position and last_position .
Amahdy at 2007-11-11 17:23:03 >

# 2 Re: Check syntax in Richtextbox
Dear Amahdy,
Thanks for your reply.But I have to check for more than one lines ?.The first line may have only opening brackets and second one may have the closing or may not
# 3 Re: Check syntax in Richtextbox
The selected text if it contains a vbcrlf (new line) it's considered as a charecter and it will look into it too if it contains the "}" or not ..
so u may pass to this function multilines no problem but keep in minde that every newline = 1 character .
Amahdy at 2007-11-11 17:25:09 >

# 5 Re: Check syntax in Richtextbox
make a counter , when you find a "{" it increase by 1 and when you find "}" it decrease by 1 .. at the end it must be zero value or u have missed brackets .. and u can know them easily as if the counter is positive say 3 so u have 3 "{" more than "}" and u need 3 other "}" missed .. and if the counter is negative say -2 the converse ..
Amahdy at 2007-11-11 17:27:14 >
