?
Solved

Pascal Compilers

Posted on 2000-04-29
8
Medium Priority
?
511 Views
Last Modified: 2010-04-16
Hi

At school we're developing pascal programs in UNIX with the Sun Pascal Compiler. We use multiple files, so we compile each file separate and then build the executeable. We use a make utility for the compiling and building. we also use a makefile.

My question is, is there a similar compiler for dos/win32 that can work with the same separate files, can compile them and can also work with a make utility and a makefile?

So that I don't have to edit the files everytime to one file for turbo pascal and separate files for SUN pascal.
0
Comment
Question by:4376
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 3

Expert Comment

by:vikiing
ID: 2762125
Borland's Turbo Pascal has the {$I filename} compiler directive, which lets you make a single program from a large amount of smaller pieces.

¿Is this what you need to know?
0
 
LVL 3

Expert Comment

by:Mathias
ID: 2762576
Show us an example.

In Turbo Pascal there are units which are compiled seperate. These units (*.tpu) will be added to the main program.

Is this your question, if not give us an example.
0
 
LVL 6

Expert Comment

by:My name is Mud
ID: 2763200
Program Test;
{$IfDef Sun}
Begin
  (* Code for the Proggys to Run in SUN, Very very hot *)
  (* More Code, hot too *)
  (* And Yet More, hot Code *)
End.
{$Else}
Begin
  (* Code for the Proggys to run in DOS *)
  (* Still Code for DOS *)
  (* Oui *)
End.
{$EndIf}
0
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 

Author Comment

by:4376
ID: 2764356
I'll give an example of what I mean.

In SUN pascal for example we use a program with 2 procedures. So with separate compiling we use in total of 5 files in unix.
Two files for each the procedures, one file with the main code and then two header files. In one header file which is called example.glob.h , all the contants and types used in the program are listed. In the other hearder file which is called example.headers.h , all the headers of the procedures are listed.

This means that you'll get something like this:

In the file proc1.p:

#include "example.glob.h"
#include "example.headers.h"

var
   ............

begin
   ...........
   ...........
end;

In the file proc2.p the same as proc1.p

In the main file example.p:

program example (input,output);
#include "example.glob.h"

var
   ..........
   ..........

#include "example.headers.h"

begin
   ..........
   ..........
   ..........
end.


In the example.glob.h :
const
   ........
   ........

type
   ........
   ........


And in the example.headers.h :
proc1;
external;
proc2;
external;

The compiling is done with a make utility and a makefile.

So I would like a compiler that can handle this structure in dos/win32 and it has to be a ISO-ANSI Pascal compliler. And to go with the compiler a make utility.


0
 
LVL 3

Expert Comment

by:vikiing
ID: 2765612
Well, what you say is more a TPU-like structure than a {$I} sequence. As TDS said, you can collect all those common procedures you want and put them toghether into a TPU file.

After that, you simply need to use the clause "Uses" to include those TPU's modules and voilá !!.

Therefore, you can create your own TPU file (which includes proc1 and proc2) and use it in your main program:

program example (input,output);
   ^^^--- a totally unusefule sentence

Uses
    MyTPU;

begin    { Main code }

    Proc1; Proc2;

end.
0
 
LVL 1

Expert Comment

by:columbo666
ID: 2768369
into file unit1.pas :
---------------------------------

unit unit1;
interface
procedure test;
implementation
procedure test;
begin
  writeln('howdy-ho');
end;
end.


into file useunit.pas :
---------------------------------
program useunit;
uses unit1;
begin
  test;
end.


this should work fine...

greets, columbo666
0
 

Accepted Solution

by:
pretty_girl earned 40 total points
ID: 2929722
There are several 32-bit Pascal compilers which run under Win32.  I recommend TMT Development Corporation's compiler - www.tmt.com.  Links to additional compilers may be found at www.geocities.com/interstaterobotics.  Click on "Hot Links" and then "Pascal".
0
 

Author Comment

by:4376
ID: 2929851
Answer accepted
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read on to get a few ideas on how to promote your next corporate event.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question