Page 1 of 1

Parantheses check

Posted: Wed Aug 31, 2005 2:49 pm
by jasonbennett1
I use textpad to write math equations that contain large numbers of parantheses. How do can I make textpad check for balanced parantheses in an equation or line?

Posted: Wed Aug 31, 2005 4:15 pm
by s_reynisson
Ctrl-M?

Posted: Sat Sep 10, 2005 10:24 pm
by tcebob
I posted this a while ago. It's as close as I can get. Position the cursor anywhere in a line and run the macro. Balancing )'s will be added to the end of the line (and before a comment beginning with ;).

Code: Select all

Script for BalParenOnLine
1   ;;from a place in the line
2  <h><h>......;;go to begin line
3  (f){(}......;;find first (
4  (f){;\|$}...;;find either ; or eol
5  (f)(up){[[:graph:]]} ;;find prev. char.
6  ->..........;;get off the char
7  ))))))))))..;;insert 10 )s
8  <h><h>......;;beginning of line
9  (f){(}......;;find the first (
10  <cm>.......;;find the matching )
11 ->..........;;get off the char.
12 (f){)*}.....;;find remaining )s

Hope it helps.

tcebob

Posted: Wed Sep 14, 2005 7:47 am
by zainka
Or simple search for ( brachets in your document and then search for ) brachets. The "Search result window will count the number of match. Since you ar familiar with mathmatics im sure you can compare the two numbers given.

Regards
Z