Solved

Pascal Compilers

Posted on 2000-04-29
8
500 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
help with delphi code 6 479
Rave Reports - Adding a Data Band 1 998
WebCam and Delphi 2 2,558
TVirtualStringTree  search using TEdit 7 106
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

911 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

20 Experts available now in Live!

Get 1:1 Help Now