trouble with tool output
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
- webber123456
- Posts: 50
- Joined: Wed Jul 30, 2003 2:55 am
trouble with tool output
I'm having trouble with tool output of TextPad (5.2).
I am unable to get the cursor to jump to the found line of the source file when double clicking a result line of the tool output.
Doubleclicking just displays at the bottom of the window "Cannot jump to item under the cursor."
sample output of the tool is;
Charts.cls(3): showmessage
How do I get this to return me to the line 3 ?
I am unable to get the cursor to jump to the found line of the source file when double clicking a result line of the tool output.
Doubleclicking just displays at the bottom of the window "Cannot jump to item under the cursor."
sample output of the tool is;
Charts.cls(3): showmessage
How do I get this to return me to the line 3 ?
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
- webber123456
- Posts: 50
- Joined: Wed Jul 30, 2003 2:55 am
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Ah. There's a problem with that. It doesn't handle drive letters properly. If there will never be a drive letter at the front of the file name, use this:
.*:([^(]+)\(([0-9]+)\)
And if there might be a drive letter, you need to be precise about what exactly is the delimiter at the beginning of the file name.
.*:([^(]+)\(([0-9]+)\)
And if there might be a drive letter, you need to be precise about what exactly is the delimiter at the beginning of the file name.
- webber123456
- Posts: 50
- Joined: Wed Jul 30, 2003 2:55 am
excellent. :D
Now I can create a function list for the working file and use it to jump to any function.
I still am unclear as to why the registers are "1" and "2"
I know TP is looking to find the 'file' and 'line' but how is it reading these two values from the reg expr. ? It appears the expression is only finding the line number.
Now I can create a function list for the working file and use it to jump to any function.
I still am unclear as to why the registers are "1" and "2"
I know TP is looking to find the 'file' and 'line' but how is it reading these two values from the reg expr. ? It appears the expression is only finding the line number.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
The regex contains two sets of capturing parentheses. The left parentheses are numbered from the left, starting at 1. The "register" numbered n holds the text that was matched by the nth parenthesised regular subexpression.
In Posix syntax, capturing parentheses are unescaped and literal parentheses are escaped. (In the default syntax it's the other way around.)
In Posix syntax, capturing parentheses are unescaped and literal parentheses are escaped. (In the default syntax it's the other way around.)
Code: Select all
1 2
| |
V V
.*:([^(]+)\(([0-9]+)\)
- webber123456
- Posts: 50
- Joined: Wed Jul 30, 2003 2:55 am
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Well, I know some of the stuff.
Anyway, someone who knows all of the stuff has already done it:
Friedl, Jeffrey E F
Mastering Regular Expressions, 3rd ed
O'Reilly, 2006
ISBN: 0-596-52812-4
http://regex.info/
This is the reference for regular expressions.
But be aware that the regular expression recogniser used by TextPad is very weak compared with modern tools. So you may get frustrated if you discover a handy trick that works elsewhere but doesn't work in TextPad.
Anyway, someone who knows all of the stuff has already done it:
Friedl, Jeffrey E F
Mastering Regular Expressions, 3rd ed
O'Reilly, 2006
ISBN: 0-596-52812-4
http://regex.info/
This is the reference for regular expressions.
But be aware that the regular expression recogniser used by TextPad is very weak compared with modern tools. So you may get frustrated if you discover a handy trick that works elsewhere but doesn't work in TextPad.