Parantheses check
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2
- Joined: Wed Aug 31, 2005 2:40 pm
Parantheses check
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?
- s_reynisson
- Posts: 939
- Joined: Tue May 06, 2003 1:59 pm
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 ;).
Hope it helps.
tcebob
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