The moment you enter the closing bracket the block until the matching opening bracket becomes selected.
So if you want to find out for an existing bracket, delete it and enter it again. I don't think there's something working like that for the opening bracket.
For better formatting use Beautify and you may not need this except for very long codeblocks. Also I don'T think there is or ever was something for the kind of brackets of codeblocks that have words like endif, endfor, enddo, endcase, endscan, etc.
Some program editors have a feature whereby when you click on a parenthesis, it automatically highlights that parenthesis and the matching one. Unfortunately, the native VFP code editor doesn't have that feature. The best you can do is to delete the parenthesis and then type it again, at which point the editor highlights the entire block of code enclosed by the matching parentheses.
(This also works with square brackets, by the way.)
I wonder if anyone has written a third-party utility to check the parentheses in VFP code?
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
I see Thor has a tool for finding matching code blocks (that is, blocks of code within control structures like IF / ELSE / ENDIF, SCAN / ENDSCAN, FOR / ENDFOR, TRY / CATCH / ENDTRY). When you run it once, it highlights the inner-most structure; then each time you run it it (from the same position), it highlights the next outer structure.
I once also saw a code viewer that used a treeview with expand/collaps function based on indentation which is working after beautify is done on the code. Beautify alone makes it readable already, but that could help with very long codeblocks. It only was a code viewer, no editor. I can imagine things like copy&paste become less easy once each code line becomes a treeview node.
WOw, I'm having flashbacks of Scheme... after writing in that language for a couple of years, I became a savant in spotting parenthetic pairs. Never thought about the editor being able to do that... ><
Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"I try to be nice, but sometimes my mouth doesn't cooperate.
Ah, and I thought there was another way also for the other block delimiters.
A detail not unknown, but also not very well known is that after an END... keyword the editor and compiler don't care, you can write what you like without using && to separate it from the code as a comment. So there you could also write a closing bracket.
But where to put the opening bracket. A comment before the IF would work, but I wouldn't like that. This needs a lot of changes to make that feature work for any block, could perhaps be automated, but then I'd prefer sensitivity for all the keywords that start and end a block, using normal brackets for that has the same disadvantage as JS, C, PHP and the like have letting every block be delimited by curly brackets. You can easily have a one off in two places that balance each other but are actually two mistakes that don't even out each other.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.