Configuring TextPad with Borland C

Instructional HowTos, posted by users. No questions here please.

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

Post Reply
tboulware
Posts: 1
Joined: Mon Apr 19, 2004 10:37 pm

Configuring TextPad with Borland C

Post by tboulware »

1. INTRODUCTION

The following describes how to install the Borland Turbo C and TextPad on your computer. Please follow these instructions very closely and ensure you get all the details correct, since missing a period, or semi-colon will prevent the compiler from working.

I have a full description of this, including screen shots; however, I am unable to include the document in the post. The following is just the text of the document. I am sorry I can't provide the complete example. :cry:

2. INSTALLING THE C COMPILER

Go to the following Borland Website (this is a free download):
http://www.borland.com/products/downloa ... ilder.html
Down the Compiler and save it to a known location on your hard drive

Once the download is complete, you can open the file to immediately install the compiler and ensure you use the default directory settings (c:\Borland\bcc55\bin) in this case. Or you can execute the freecommandlinetools.exe program directly from the directory where you save the file.

Create the configuration files inside the c:\Borland\bcc55\bin directory:

1. Create a file called bcc32.cfg file which will set the compiler options for the Include and Lib paths (-I and -L switches to compiler) by adding these lines:

-I"c:\Borland\Bcc55\include"
-L"c:\Borland\Bcc55\lib"

2. Create an ilink32.cfg file which will set the linker option for the Lib path by adding this line:
-L"c:\Borland\Bcc55\lib"

3. SETTING THE PATH
The following are the steps to setup the Path on a WinXP system. Your system may be a little different; however, the basic steps will be the same.
1. Go to the Control Panel
2. Double-click on the System icon
3. Click the Advanced tab

4. In the System Variables window find the Path statement and hit Edit, or New, if the Path statement doesn’t exist as shown below:

Then type in the following statement at the end of the Path statement line:
1. If the Path string already contains a statement, type a ; (semi-colon) at the end of the command.
2. Type the complete path name of the bin directory created by freecommandlinetools installation, on my system this direction is c:\Borland\Bcc55\Bin.

A good way to ensure you type this in correctly is to open up Windows Explorer and navigate to this directory, then select the complete directory name from the Address field of Windows Explorer and then click on CRTL-C (Copy), which copies the path name to the clipboard. Then after you have entered the semi-colon from step 1 (if required) to the end of the path statement hit CRTL-V (Paste) and the correct directory string will be pasted into the Path command.

3. At the end of Path statement type another ; (semi-colon), then a . (period), and finally an ending ; (semi-colon). The complete string you added should look like the following:

c:\Borland\Bcc55\Bin;.;

4. INSTALLING TEXTPAD

Note, at a minimum you should have already installed the C Compiler and set the Path statement in the Environment Variables of your Control Panel|Advanced tab.

1. Download TextPad from http://www.textpad.com. where the latest version is 4.7.2.

2. Once you have downloaded the installation file, double-click on the file txpeng472.exe (or whatever version you downloaded.) TextPad will install itself and inspect the Windows Registry to determine where you have installed the Java SDK.

3. After the installation is complete, open up TextPad and click on CONFIGURE|PREFERENCES as shown below:

4. Click on ADD|PROGRAM

5. Navigate to the c:\Borland\Bcc55\Bin directory and click on bcc32.exe the tool will then be added to the list of tools.

6. Double-click on the bcc32 line and rename the tool to Compile C (note, you may have to double-click a few time to get the edit field working, but keep at it will work). Click Apply and Compile C will show up on the tool list.

7. In the Tool List on the left, click on Compile C and fill in the fields as shown below: (cut and paste the following into the Command Field

Command: C:\Borland\BCC55\Bin\bcc32.exe
Parameters: $File
Initial Folder: $FileDir
Regular expression: ^\([^(]+\)(\([0-9]+\)):

8. Click OK

9. Click on Tool again to Add a DOS Command, which will automatically execute the program in a DOS command window.

10. Type cmd.exe in the DOS Command field and click OK.

11. Rename cmd.exe to Run C Application and click Apply.

12. Click on the Tools|Run C Application item in the Tool List and fill in the following:

13. Click Apply and the run command will be added to the TextPad Tool Menu

14. Test the installation by:
a. Creating a blank TextPad document
b. Save the document as “HelloWorld.c�
c. Cut and paste the following code:
#include <stdio.h>
int main(void)
{
printf("Hello world\n");
printf("Hit any key to continue:");
getchar();

return 0;
}
d. Compile the program by selecting TOOLS|COMPILE C (or Ctrl+4)
e. Execute the program by selecting TOOLS|Run C Application (or Ctrl +5)
f. If the program does compile and execute, follow the instructions again and ensure all the steps have been completed and all the details have been satisfied.
Image
BobPaul
Posts: 1
Joined: Mon Nov 08, 2004 7:18 pm

Sort of Works, but Error Handling doesn't

Post by BobPaul »

I can't quite get this to work properly. Sure it compiles my app and all, but I don't like the way it's handling errors.

When I get a compiler error in java, I can double click on the error and it takes me to that line in the program.

As I understand it, this is because the regular expression for the Compile Java tool matches the error output.

I've tried the regular expression you give in your post:
^\([^(]+\)(\([0-9]+\)):

Plus the one on the tips page:
^\(Error\|Warning\) [^ ]+ \(.+\) \([0-9]+\):

And the one in the TextPad Help file:
^\(Error\|Warning\) [A-Z][0-9]+ \(.+\) \([0-9]+\):


I've tried these expressions with and without the trailing spaces, and have played with the register values, but nothing works. The program always compiles fine, but I still can't double click on the errors to jump the the line number. In all actuality, there's no difference that I can tell between using one regular expression over another.

Anywone know the proper regular expression to use so that I can double click errors?

[EDIT]
Here's an example of the command results window I recieve with any of the above 3 regular expressions

C:\homework5.cpp:
Error E2141 C:\homework5.cpp 15: Declaration syntax error in function main()
Error E2451 C:\homework5.cpp 19: Undefined symbol 'outFile' in function main()
*** 2 errors in Compile ***

Tool completed with exit code 1

It'd be ideal if the command window looked more like this:

C:\homework5.cpp:
15: Declaration syntax error in function main()
19: Undefined symbol 'outFile' in function main()
*** 2 errors in Compile ***

and if I double clicked on one of the two errors, it would take me to the line number listed. I've looked in the help in text pad and tried to make my own regular expression or edit the ones given in various places (the 3 I found are above) but it seems I just don't quite understand what I'm doing.
[/EDIT]
krkwdftball61
Posts: 1
Joined: Tue Nov 07, 2006 2:26 am

thanks

Post by krkwdftball61 »

thanks but you forgot to post what to fill in in step 12. i couldn't figure out why my apps weren't executing until i realized that i hadn't set the Parameters as '$BaseName.'
Post Reply