I think I have just stumbled upon a most fantastic way of using TextPad (well, if you are a c programmer that is). It makes textpad easily as good as MS VisualStudio as an IDE for C programming.
What it does:
It allows you to edit, seamlessly, a large C source-file tree, spread over many directories, with the ability to double-click on a C function call, and be transported to the function definition, even if it is in another file or directory. Wow !!! You can just hop around the project, function to function, not worrying about the location of the files.
( This isn't quite as good as auto-complete in Visual Studio, but its pretty good. )
I have been using this to help me get to grips with a HUGE C project which I am unfamiliar with (so I don't know which files all the functions are in), and it works beautifully.
Here are some instructions for setting things up as I have, which maybe will only be of use to a C programmer.
Steps.
1) CXT
-------
Get a free utility, called CXT, available from //www.bigfoot.com/~sxt.
try to get version 2.64 or greater. This does many good things, but we're going to use it to create a database, and then query it. Install it, by simply putting exe's and dll's into PATH. Read the docs by all means, but you could probably just charge ahead with commands given below.
2) Create database
------------------
assume there is a C development source tree rooted at c:\blah\project.
create a directory for the database, maybe c:\blah\doc
cd to \blah\doc, and issue the following command to create the database.
cft -G -N +c:\blah\doc\*.*
( You will probably get zillions of warning messages about the code, but this never seems to prevent it from creating a useful database. In case of difficulty, consult SXT.DOC, although this is a rather large and complex piece of software. )
this may take some time!
You should now have some *.DBF files in the \doc directory.
3) test database (optional)
--------------------------
Before modifying TextPad, we can test that everything works, by trying a simple query:
> cftn -b main
Here "main" is the name of a function we are looking for somewhere in the project. It should repsond with a filename and line number of the C definition of that function.
4) configure textpad (once only)
--------------------------------
What we now have to do is configure textpad to use this information to jump to the right file/line number
Observe the output of this command:
> cftn -b"TextPad %s(%d)" main
It is outputting the command we need to start textpad. We need textpad to be in the PATH to get this command to work, so make sure that it is.
Create a windows batch file, cxtlink.bat, and put it in the PATH
it should contain something like:
cftn -b"textpad %%s(%%d)" %1 >cxttemp.bat
cxttemp
i.e. we use the output of cftn to create a single line .bat, which we then execute.
you have to double up on the %%'s to pass the "%s(%d)" through to cftn without molestation by the dos .bat engine. The %1, which isn't doubled, is replaced by the parameter passed.
We now get textpad to execute cxtlink.bat , passing as an argument the text that is highlighted (which ought to be the name of a c function). This can be done in Config/Tools/add/dos-command by using the $Sel parameter to pick up what the user has double-clicked on.
IMPORTANT: In the configuration of this textpad tool, you need to set the working directory to the c:\blah\doc directory, so that the database will be found. You probably also want to run minimised, and not capture output, and close on exit.
5) Programmer Heaven Awaits !
------------------------------
Once you have done all this, you should be able to edit a C source file deep within the tree below c:\blah\project, and then double click on a function call, press the correct tool key, and then find yourself looking at the code of that very function. And do it again. And again.. FANTASTIC!!!!!
Contributed by Stuart Mitchell.
c function call hyper-links
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 16
- Joined: Fri Jun 13, 2003 12:46 pm
- Location: The Netherlands
Re: c function call hyper-links
Free??? It is 25 euro shareware!helios wrote:Get a free utility, called CXT, available from //www.bigfoot.com/~sxt.
I wrote a free Add-on that does the same as described here (and more). It is relies on ctags and version 2.0 has turned Open Source.
You can find my add-on at http://findtag.sourceforge.net
Frank
!! This is a really great tool !!
It integrates ctags.exe in TextPad very well.
It is most useful for browsing through a huge C project which I didn't write myself.
I have just to place the cursor over a "tag" (function, variable, structure member, typedef,...) and press <Alt><Right> (this is the KeyShortcut I assigned to FindTag.exe) which will take me to the definition of the tag even if it's in another file not open in TextPad.
<Alt><Left> takes me back where I came from
Additionally you can invoke FindTag with options so that a window opens showing all Tags in a tree view
THANKS FRANK !!!!!
Wolfgang
It integrates ctags.exe in TextPad very well.
It is most useful for browsing through a huge C project which I didn't write myself.
I have just to place the cursor over a "tag" (function, variable, structure member, typedef,...) and press <Alt><Right> (this is the KeyShortcut I assigned to FindTag.exe) which will take me to the definition of the tag even if it's in another file not open in TextPad.
<Alt><Left> takes me back where I came from
Additionally you can invoke FindTag with options so that a window opens showing all Tags in a tree view
THANKS FRANK !!!!!
Wolfgang
I just get the error dialog box "Not enough command line parameters!" when I do that. Can you tell us the whole command line and parameter list?woho wrote: invoke findTag with parameter "-back" !!
Create a TextPad tool:
command:FindTag.exe
parameter: -back
assign <Alt><Left> as Keyboard Shortcut to the new Tool
woho
[/img]
http://findtag.sourceforge.net/
the instructions there work fine. maybe you have an older version of findtag?
the instructions there work fine. maybe you have an older version of findtag?
-
- Posts: 41
- Joined: Sat May 20, 2006 9:10 pm
- Location: Helsinki
- Contact:
I have the newest version and still getting the same error message :crackwitz wrote:http://findtag.sourceforge.net/
the instructions there work fine. maybe you have an older version of findtag?
[HKEY_CURRENT_USER\Software\Helios\TextPad 4\Tools\16]
"Properties"=hex:00,00,00,00,66,80,00,00,40,00,00,00
"MenuText"="Back"
"Command"="C:\\utils\\FindTag.exe"
"Parameters"="-back"
"Folder"=""
"RE"=""