Solved

Pascal Compilers

Posted on 2000-04-29
8
499 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
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
 

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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 20 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
A Short Story about the Best File Recovery Software – Acronis True Image 2017
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now