## setting up UES for BP7 - Borland Pascal 7

Building, compiling, or debugging issues

### setting up UES for BP7 - Borland Pascal 7

Hello,
I just inherited an old project written in BP7.
I have the compiler installed on the PC in C:/software/Bp701.
Since I am allergic to the BP7 IDE, I was wondering how to configure UES to replace the old IDE.
Has anyone tried (and succeeded) in setting up UES for BP7?
Best regards,
Roland
rlegall
Newbie

Posts: 5
Joined: Thu Aug 26, 2010 5:24 am

### Re: setting up UES for BP7 - Borland Pascal 7

That should be quite easy because Borland Pascal 7 is one compiler for which configurations are already pre-installed with UEStudio created probably by another user. So you just have to setup a project, select Borland Pascal 7 for this project and select the appropriate configuration Dos16, Dos32, Win16. Because this old compiler is not registered in the registry, you have to set additionally the path to BP7 in Build - Set Compiler Paths. As I can see there are only 5 compiler options defined in the 3 configurations for being set by you in Build - Set Compiler Options.
Best regards from Austria

Mofi
Grand Master

Posts: 4195
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

### Re: setting up UES for BP7 - Borland Pascal 7

Hi Mofi, and thanks for the support.
I have set this path already, and when trying to compile, I get a pop-up message window saying "Cannot compile the file "C:\DOCUME~1\rlegall\MYDOCU~1\Projects\TCU\tcu.pas" !No compile tool is associated with the file extension."
It seems quite an obvious pb to solve,but after going through the menus and options I can't find where to define this. I can see :

[FileGroups]
FGP = .pas;.asm;

in the "select compiler" menu configuration...
Thanks
Roland
P.S. I am a long time user of UE, which I find is a great product, and will definitely upgrade to ues should I manage to get this to work.
rlegall
Newbie

Posts: 5
Joined: Thu Aug 26, 2010 5:24 am

### Re: setting up UES for BP7 - Borland Pascal 7

You are right. It looks like the author of the configuration files for Borland Pascal 7 has used only the Build command and therefore there is nothing in the 3 configurations to just compile current Pascal file to an object file or even an executable when the application does not depend on other source files.

A section [.PAS] with the appropriate commands to compile current *.pas source file only is missing in all 3 configurations for BP7. Also the configurations for Delphi, TMT Pascal and Turbo Pascal 6 don't have a section defined for just compiling a single file for a project. Only the configuration file for FPC Pascal DOS contains such a section.

So you either use always the Build or Rebuild commands or you enhance the configuration files for BP7 and add a section [.PAS] for just compiling a single *.pas file of a project to an object file.

Programmers use often only the Build command and rarely the Compile command because compiling a source file to an object file is useful only for finding syntax errors, but produce no new executable which can be executed for testing.
Best regards from Austria

Mofi
Grand Master

Posts: 4195
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

### Re: setting up UES for BP7 - Borland Pascal 7

Hi Mofi,
You're right, I am not so bothered to compile as I am to be able to build.
The problem is that I can not build either. I just wanted to start with a simple problem rather than the full blown build...
Anyway, I understand that this bp7 profile was sent by a user; so would you be able to provide me with the publisher's details so that I could ask him directly what worked for him?
I am stumbling on a few problems:
first one was to run the bpc from a different directory to the BP7 which wouldn't work. I corrected this by adding the compiler path before the bpc call. subsequently bpc attempts to run, but produces an error code:

--------------------Configuration: TCU - Release--------------------
Borland Pascal Version 7.0 Copyright (c) 1983,92 Borland International
Invalid command line option: "/$CW" TCU.EXE - 0 error(s), 0 warning(s) This time I am at loss to get it working myself and I probably need the help of someone who has managed to get it working... best regards, Roland rlegall Newbie Posts: 5 Joined: Thu Aug 26, 2010 5:24 am ### Re: setting up UES for BP7 - Borland Pascal 7 I'm a user like you, not an employee of IDM. I don't know who created the BP7 configurations. And I don't have Borland Pascal 7 nor any other Pascal compiler. I have just experience in setting up environments for different compilers, first done for UltraEdit, and since release of UEStudio for UES. The first configuration I used myself was the DJGPP configuration, written by another user. I needed 10 minutes to setup my project and it build the first single project quite fine, although I needed also to set the compiler path to the DJGPP directory in the "Set Compiler Paths" dialog. I had warnings on my first compilation because my DJGPP version was newer as obviously the one used by the creator of the configuration and therefore DJGPP told me with a warning to use a newer option instead of the deprecated older one, but I could quite easily change that in the configuration. However, I suppose you use the "Win16 Application" configuration because this BP7 configuration is the only one containing "CW". The important sections are: [Variables] CPATH =C:\BP COPT = -CW -B$(Alignment) $(Full Boolean)$(80x87) $(Stack Checking)$(Instructions)

[Environment]
PATH = $(CPATH)\BIN [Build] Out =$T
Depends = $FGP ReleaseFlag = -$D- -$L- -$K+
DebugFlag = -V -$D+ -$L+ -$K- Cmd0 = bpc$(Compiler Options) $(COPT)$R $FGP The CPATH variable should contain now already the path to the BP7 directory (in 8.3 format!) which contains the directory BIN in which there should be a bpc.exe. All the compiler options defined for COPT are appended as options to the build command. I don't now where /$CW really comes from. According to what I see in the configuration that should not happen.

The configuration contains also a [Show Makefile] section. Therefore you can run from within UEStudio Build - Run Commands - Show Makefile to get in UEStudio opened the makefile used to compile your Pascal project. Perhaps you see in the makefile what is wrong and where is the reason.

You can also enable in Build - Advanced Build Options the option Show build commands when executing to see in the output window also the commands used during build process.

Of course all that output is only helpful when you have the manual for the compiler and will make use of it by reading in the manual.
Best regards from Austria

Mofi
Grand Master

Posts: 4195
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

### Re: setting up UES for BP7 - Borland Pascal 7

Hi Mofi,
I hope you are ok, and thanks for taking the time and effort to look into my problem.
I am surprised you are not working for IDM. If I was managing IDM I would consider getting you on the payroll, in regards to the level of support you provide!
I have managed to dig the compiler manual in my company's cupboards... and whatever I try from the command line I can't get any results whatsoever: it always comes back with this error "Invalid command line option: "/$CW" ". Now this is really surprising as I am not using the windows target. If only I could spy the command line build from the bp ide, it probably would be the solution... but that's a big if. This is not a UES problem, so I apologize for posting in the wrong place. Best regards, Roland rlegall Newbie Posts: 5 Joined: Thu Aug 26, 2010 5:24 am ### Re: setting up UES for BP7 - Borland Pascal 7 Long time ago I have written for myself a very small application to find out how various versions of Windows call 16-bit DOS applications and 32-bit console applications. I translated the few strings of this small application now from German to English and compiled it with DJGPP (ArgvEn32.exe) and a very old Turbo C compiler (ArgvEn16.exe). In the attached ZIP file there is the source code and the two compiled EXEs. You can rename now bpc.exe of your Borland Pascal 7 for example to bpc_bak.exe and then use ArgvEn16.exe with the file name bpc.exe. Perhaps you can see with this small tool how the Borland Pascal compiler is called. If that is not helpful because the old IDE is capturing and filtering the output of the compiler, I can very easily change the code to additionally write the arguments to a file. Attachments ArgvEn.zip Small 16-bit DOS and 32-bit console application with source code to see command line arguments. (35.18 KiB) Downloaded 235 times Best regards from Austria Mofi Grand Master Posts: 4195 Joined: Thu Jul 29, 2004 11:00 pm Location: Vienna ### Re: setting up UES for BP7 - Borland Pascal 7 Hi Mofi, I replaced the compiler with your application, and I realized it is never called when compiling... So to check what was happening I removed all the .exe from the directories, and the compiling still works. It looks like the compiler is embedded in the exe, crazy stuff. So I reverted to using the dos version, which won't compile the project anyway.... If someone ever manages to get the compile/build working, I would be very interested in hearing about it. In the meantime I have to send my special thanks to Mofi for his precious help. Best regards, Roland rlegall Newbie Posts: 5 Joined: Thu Aug 26, 2010 5:24 am ### Re: setting up UES for BP7 - Borland Pascal 7 I am not using "Borland Pascal 7", but, rather, "Turbo Pascal 7" which is basically the exact same product, but for DOS only and does not compile for Windows. I have successfully gotten it to work with UES '10 with no trouble. The command line options are supposed to be the same for Turbo Pascal 7 and Borland Pascal 7 from what I understand, except that the Turbo version does not allow as many options. I made the following changes to the Borland Pascal 7 / DOS 16 Application section: Code: Select all [Variables]CPATH =C:\path\to\tp7#COPT = -CD -B$(Alignment) $(Full Boolean)$(80x87) $(Stack Checking)$(Instructions)COPT = $(Alignment)$(Full Boolean) $(80x87)$(Stack Checking) $(Instructions)[Build]Out =$TDepends = $FGPReleaseFlag = -$D- -$L- -$K+DebugFlag = -V -$D+ -$L+ -$K-Cmd0 = tpc /B$(Compiler Options) $(COPT)$R $FGP[Compile]Out =$TDepends = $FGPReleaseFlag = -$D- -$L- -$K+DebugFlag = -V -$D+ -$L+ -$K-Cmd0 = tpc /C$(Compiler Options) $(COPT)$R \$FGP

Notice I commented out the COPT line and replaced it with a line that removed the -CD and -B flags.

In the Build and Compile sections you would want to replace Cmd0 with "bpc" instead of "tpc", but the rest should work properly for you, as far as I know. It certainly should not hurt to give this a try. Let me know if it works for you. I don't have access to the Borland version, only the stripped down Turbo version, so I haven't been able to test it directly.
“Don’t document the problem, fix it.”
– Atli Björgvin Oddsson

rhapdog
Master

Posts: 286
Joined: Tue Apr 01, 2008 10:02 am
Location: Mississippi, USA