Tools: Registers - File, Line, Column

General questions about using TextPad

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

User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Tools: Registers - File, Line, Column

Post by delley »

Hi all,

Is there anyone that can explain how the registers under tools configuration work ??? Please give examples :wink:

I'm trying to set-up "captured-output-doubleclick" function for ant.

In advance thanks,


delley
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

There are plenty of examples in TP's help file.
Look under Regular Expressions to Match Compilation Errors and
How to Use with Compilers.
Also other entries if you search for tool register. HTH
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Post by delley »

Thanks for your reply :D

But I've searched through the Textpad help with out finding anything that specifically explains what they (file, line, column) are for. I also looked in the sections you suggested

From texpad help:
A regular expression that matches the output must be typed in the Regular Expression box, and the file name, line and column registers set to the appropriate values. See Regular Expressions to Match Compilation Errors for more information.
From regular expressions:
In general, each line must include a file name, but there is one special case: if the output specifies only the corresponding line numbers (and optional column numbers), the file name is assumed to be that of the document that was active when the tool was started. For an example, see "Tidy HTML", below.
I don't think that this covers the subject very much...

I can make qualifyed guesses to what they mean but I would rather have it explained :lol:

Regards,


Delley 8) 8) 8)
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

I must be missing something in your post :oops:
Again, from TP's help file: Hypertext links from file search and user tool
output to the relevant source line.

ie. when you are in a captured output window in TP, in many cases from a
compiler, double clicking on a error line in that output will take you to the file
and postion you on the line and column.
delley wrote:... But I've searched through the Textpad help with out finding anything that specifically explains what they (file, line, column) are for. ...
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Post by delley »

ups :oops: I think I've managed to explain my problem badly :oops:

I wanted to know how to use the registers: File, Line and Column

Sorry! :oops:


Am I reading you correctly if I say that the registers is used to define the file, line and column that you will be moved to if you double-click the captured output ???
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

BINGO :!: :D
Then I open up and see
the person fumbling here is me
a different way to be
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Post by delley »

ALLRIGHTY THEN :!: :!: :!:

Could you be so kind to give some examples :mrgreen:
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

As I understand it (maybe someone would like to confirm this):
This is from TP's help file, from How to Use with Compilers.
Menu text: Compile C++
Command: C:\Borland\BCC55\Bin\bcc32.exe
Parameters: $File
Initial directory: $FileDir
Capture Output: [x]
Save files: [x]

Then set the regular expression as follows:

Expression: ^\(Error\|Warning\) [A-Z][0-9]+ \(.+\) \([0-9]+\):
File Register: 2
Line Register: 3
Here the first register is not used, ie. the (Error\|Warning\),
used to group the items together to create an "or" statement for the regex,
the second contains the filename, ie. (.+\)
and finally the third contains the line number, ie. ([0-9]+\).
Column number is not used at all here, not a part of the C++ compiler output.

Edit: If you are not a "regex geek" you can post a sample output here and
tell us what lines you need to capture, plenty of us "geeks" here ;)
Then I open up and see
the person fumbling here is me
a different way to be
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

This still isn't clear to me either, I've got a similar problem going at http://textpad.com/forum/viewtopic.php?t=4968

so if "finally the third contains the line number, ie. ([0-9]+\). " shouldn't that be \([0-9]+\) with the leading backslash (not trying to be picky, just trying to be sure I understand correctly). This is considered the 3rd since:

\(Error\|Warning\) is the first
\(.+\) is considered the second

so you set the line number pulldown to 3 in the tool setup dialog?

nowhere in the doc/help does it mention the relationship between the regexp that lays ( and ) into the match and the file/line/column settings
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Yes. For clarity I used only the ().
... so if "finally the third contains the line number, ie. ([0-9]+\). " shouldn't that be \([0-9]+\) with the leading backslash (not trying to be picky, just trying to be sure I understand correctly). This is considered the 3rd since:
\(Error\|Warning\) is the first
\(.+\) is considered the second
Yes.
so you set the line number pulldown to 3 in the tool setup dialog?
You may be right on this, I usually tend to have a very high opinion of TP's
help file, but in this case there seem's to be a "blank";)
nowhere in the doc/help does it mention the relationship between the regexp that lays ( and ) into the match and the file/line/column settings
Found this at http://textpad.com/support/tips/index.html#Pascal , I think it
confirms what we have been wondering about the registers.
Regular expression for the free Pascal compiler:
Expression = \([^(]+\)(\([0-9]+\),\([0-9]+\)
File Register = 1
Line Register = 2
Column Register = 3
Last edited by s_reynisson on Thu Jan 22, 2004 4:37 pm, edited 1 time in total.
Then I open up and see
the person fumbling here is me
a different way to be
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

thanks for the prompt reply, could you take a second and look at my issue with textpad and tidy? its at http://textpad.com/forum/viewtopic.php?t=4968, any help appreciated

Mike
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

I've been following that thread but since I do not have Tidy on my puter I can
only test the regex in my editor and using POSIX this works fine for me:
^line ([0-9]+) column ([0-9]+) - Warning: .*$
I double checked using Replace and I always got the correct line+column
from registers 1 and 2.

Code: Select all

find ^line ([0-9]+) column ([0-9]+) - Warning: .*$
replace \1+\2
This regexp is really the same as posted by Helios in the HOW-TO's.

From your post: "params: errors -quiet $File" but in the HOW-TO's
it reads "params: -errors -quiet $File". Can you double check it?
Then I open up and see
the person fumbling here is me
a different way to be
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

s_reynisson wrote:I've been following that thread but since I do not have Tidy on my puter I can
only test the regex in my editor and using POSIX this works fine for me:
^line ([0-9]+) column ([0-9]+) - Warning: .*$
I double checked using Replace and I always got the correct line+column
from registers 1 and 2.

Code: Select all

find ^line ([0-9]+) column ([0-9]+) - Warning: .*$
replace \1+\2
This regexp is really the same as posted by Helios in the HOW-TO's.
In the find dialog, I was able to get it to match on only the column, only the line, and the entire line (depending on how much of the regexp I put into the find dialog). So I think I'm past the point of considering that I've done something dopey that is causing this not to work. (of course now by stating that publicly it will turn out to be something simple that I've overlooked...)

The problem is placement of the cursor in the column when I click on the results. It seems to return in some random spot > col 1. I have column set up as 2 in the tool setup, with line in 1 and file blank.
From your post: "params: errors -quiet $File" but in the HOW-TO's
it reads "params: -errors -quiet $File". Can you double check it?
good catch, i just didn't get the leading '-' when i cut and pasted, I just checked and its in there. <whew> woulda felt kinda stoopid if i missed that one...

If you feel like giving it a shot, the tidy exe is a small (272k) single file available from http://htmltrim.sourceforge.net/tidy.html, I grabbed the first zip/exe on the page and d/l'd it (the January 10th 2003 tidy-exe.zip file). created a ./tidy subdir at the same level as system, samples, spelling - and mapped it out in tools.
User avatar
s_reynisson
Posts: 940
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Works for me using just the HOW-TO's post.
The only change I made was to strip the \'s since I'm using POSIX.
My settings are:
Command: C:\Program Files\TextPad 4\Tidy\tidy.exe
Parameters: -errors -quiet $File
Intial folder: $FileDir
Ticked: Capture output, Sound alert when completed.
Regex to match output: ^line ([0-9]+) column ([0-9]+)
(using POSIX)
Registers: File *Blank* Line 1 Column 2
Then I open up and see
the person fumbling here is me
a different way to be
mike_d
Posts: 17
Joined: Mon Dec 01, 2003 9:44 pm
Location: Sonora, CA

Post by mike_d »

upgraded from 4.7.1 to 4.7.2 and now its working for me too

thanks to all for all the help
Post Reply