Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pascal Compilers

Posted on 2000-04-29
8
Medium Priority
?
512 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
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

876 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