Parantheses check

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jasonbennett1
Posts: 2
Joined: Wed Aug 31, 2005 2:40 pm

Parantheses check

Post 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?
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Ctrl-M?
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
tcebob
Posts: 80
Joined: Fri Mar 28, 2003 1:20 am

Post 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
zainka
Posts: 33
Joined: Tue Apr 29, 2003 6:40 am

Post 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
Post Reply