Tools - Registers - ascertain file, line or column setting?

General questions about using TextPad

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

Post Reply
BryceS
Posts: 22
Joined: Tue Dec 02, 2003 12:53 am
Location: New Zealand

Tools - Registers - ascertain file, line or column setting?

Post by BryceS »

Hi, I've looked at previous posts to this forum but I still can't figure out what I need when configuring a new 'tool' to do code compiling (using FourJs BDL).

I get code compiled and error file opened ok, but jumping to the first error has me stumped.

The regular expression I would normally use in textpad to jump to an error is:

^\|

But how can I use this info to make the opened error file jump to the first error on open? How do I set the file, line and column settings? And do I need to add more the above regular expression for it to work?


As an example below is a snippet from an error file to show what we get:

declare rbm01_chk_rslts_entered cursor for
select *
from horse_bicarbonate
where hb_horse_id = horse_id
and hb_racehdr_id = racehdr_id
and (length(hb_lab_number) > 0
or hb_finances_upd = "N"
open rbm01_chk_rslts_entered
| A grammatical error has been found at 'open' expecting: OR AND ')'.
| See error number -6609.
fetch rbm01_chk_rslts_entered into horse_bicarbonate.*
if status = 0 then
.....


Thanks for any assistance.
Regards,
Bryce Stenberg
(Harness Racing New Zealand computer dept.)
BryceS
Posts: 22
Joined: Tue Dec 02, 2003 12:53 am
Location: New Zealand

Post by BryceS »

One more thing that maybe has a bearing on my issue.

I run the compiler from a batch file.
The batch file has to explicitly open the error file in textpad for me.
eg. start textpad "n:\compile\%1.err"
Is this why the registers and regular expressions are maybe not effective?

Regards,
Bryce Stenberg.
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

You're right about the bat file, skip that and call your compiler from the tools menu in TP. Take a look at TP's help file under "How to Use with Compilers" and from there "Other examples" at the bottom of the page. There is also a brand new HOW-TO here for BC and also for BCC here.
You will also need to set your compiler options to report the file name, line and column number, the file name and column number are optional. From TP's help file:
Generic filename(line,column)
Expression = ^\([^(]+\)(\([0-9]+\),\([0-9]+\))
File Register = 1
Line Register = 2
Column Register = 3
Using POSIX this regex would look like ^([^(]+)(([0-9]+),([0-9]+)).
Then I open up and see
the person fumbling here is me
a different way to be
BryceS
Posts: 22
Joined: Tue Dec 02, 2003 12:53 am
Location: New Zealand

Post by BryceS »

Thanks for reply.

I guess I will just have to be happy with opening the .err file myself and no jumping to first error line.
I can not get away from having the batch file run as it copies files to appropriate directories, filters out unwanted lines depending on what version one is compiling for and finally moves files from a successful compile to a directory holding all the executable code.

Additionally the compiler has no options for varying its output, it either succeeds or fails with all errors written to error file.

Thanks again,
Bryce Stenberg.
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Ok, depending on what your bat file is sending to stdio etc this could be a longshot, but IMHO worth the effort if you got the time to burn. ;)
To give you a hint here's what I just tested (it works btw).
To call html Tidy I had this set as parameters under the html Tidy tool in TP:
-config C:\tidy\tconf.txt -errors -quiet $File
So I created a bat file called tidy.bat and it contains:
@echo off
C:\tidy\tidy.exe -config C:\tidy\tconf.txt -errors -quiet %1

and I now call tidy.bat from TP using the parameters:
$File
TP does capture the output in the Command results and I can click the lines to take me to the errors and warnings. You might have to spend some more time on the regex to match output but it just might work. Oh, and of course your compiler will have to send it's output to stdio and not a file, but you should be able to change that in your bat file. But please remember that my hopes are not that high bearing in mind the example output you posted in your first post, ie. you still need to able to weed out a line number for this to work. :roll:
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply