Solved

Pascal Compilers

Posted on 2000-04-29
8
503 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to delete from listbox using edit box 6 305
TClientSocket.SendStream is slow... 2 972
Delphi XE 5 - windows 3 889
creating manifest for my dll that called from activex 6 133
Read our guide on how to survive being on-call.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

756 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