PDA

View Full Version : pascal programming




green.apple
Feb 21, 2013, 07:11 AM
i would like to use pascal under mountain lion.in windows i used a program who looked like this.
http://progopedia.com/static/upload_img/2009/12/07/tp7.png
i tryed lazarus(installed xcode,fpc ,fpc sources) and still dosen't work propertly for me.what should i use?or,how do i make it work? or what other similar programs are for pascal?
i'm using mountain lion 10.8.2.



benwiggy
Feb 21, 2013, 08:00 AM
Exactly how are you intending to use your Pascal code? Are you wanting to write Mac programs?
Or is this just within a "platform-free" closed environment? That image you posted looks like an ancient DOS-based Pascal program. What sort of programs are you intending to write?

Pascal is a fairly dead language these days. While parts of the original Mac OS were written in Pascal, this is all gone, and there are only a few quirks that remain from its legacy.

However, a quick Google for "Mac Pascal" reveals several free implementations.

You might be better served learning a language like Objective-C, Python, Ruby or even Unix shell-scripting, which are more useful for creating useful code on modern computer systems. (I say this as someone who learnt Pascal at University.)

ghellquist
Feb 21, 2013, 10:21 AM
i would like to use pascal under mountain lion.in windows i used a program who looked like this.
http://progopedia.com/static/upload_img/2009/12/07/tp7.png


Aaahh. Turbo Pascal on Dos. Those were the days! Long time gone though.

As already said, Pascal is more or less dead now. So if you want to program "useful" things there are better choices of program language. Of course, if you want to rerun som old programs or simply dust off some old knowledge it can be a good choice.

// gunnar

balamw
Feb 21, 2013, 10:25 AM
One user here took a Pascal course recently in community college.

More about this here: Pascal Programming (http://forums.macrumors.com/showthread.php?t=1101131).

You may not easily find an IDE like Turbo Pascal for the Mac.

B

green.apple
Feb 22, 2013, 07:01 AM
i need pascal for school.i need to run it ,so i can learn something.it's not a programming language of my choice.i'd go for python or c instead,but it isn't my choice.i need to use pascal.there's any way? i searched and readed a lot.
i don't wanna convert from c code to pascal or other things..

balamw
Feb 22, 2013, 07:08 AM
Since you claim you already tried fpc have you tried GNU pascal?

Also how exactly did Lazarus/fpc not do the job for you? http://whathaveyoutried.com

Since it's needed for school, what is the school working on? Are they seriously working Turbo Pascal in DOS? (IIRC larswik's course was using a TPC book with some pascal under linux).

If they have it working under linux set up a VM and use what they have.

B

green.apple
Feb 22, 2013, 08:33 AM
yes,we're using windows xp.for that.this is programming basics.that's teaching in school.i want to be able to do my homework,and study aswell.i have a apple laptop,can't install windows on it(or linux for that matter)i want to run it in mountain lion.. don't wanna get complicated with virtual machine or something...a simple program like, hello program,it dosen't work.
something like this:
begin
writeln ('hello');
end.
this is the simplest program i know and dosen't work...
i installed xcode,lazarus,fpc,fpc docs,etc...tryed evan code:blocks...still ain't working.

Ap0ks
Feb 22, 2013, 08:59 AM
If you wanted it to be the same as at school, you could always see if Turbo Pascal would run in DOSbox or Boxer.

larswik
Feb 22, 2013, 02:34 PM
I had to do the something a few years ago when I started school. I installed on my Mac http://www.ubuntu.com/ operating system. I then installed somethinf like Free Pascal and it worked like a charm. Look at this link http://fusharblog.com/installing-free-pascal-in-ubuntu/

Pascal is pretty useless in the real world today but it is great to learn and you will take all the principles you learn to other languages.

ratfink
Feb 22, 2013, 02:38 PM
I wonder if Turbo Pascal would run under DosBox. You should give that a try.

edit: according to the link below, it runs fine.

http://fuyichin.blogspot.com/2008/04/turbo-pascal-on-dosbox.html

certsoft
Feb 22, 2013, 03:42 PM
I've run Borland Pascal 7 using a program called "Boxer" in the past for updates to an old (turn of the century) product.

Pascal is not useless, it's more advanced version Object Pascal is the basis of Delphi which many people use all over the world.

When I got a new MacbookPro earlier this year I installed Lazarus on it and it worked fine (as long as don't mind bloated executables). I've never tried just using FPC by itself. I have some Delphi programs that are console programs (so simple stuff like hello world will work) but I've never tried to make a console program under Lazarus.

green.apple
Feb 23, 2013, 07:11 AM
there isn' any native program?

balamw
Feb 23, 2013, 07:15 AM
there isn' any native program?

You still haven't given us any more information other than "dosen't work propertly for me". What exactly doesn't work? How does it fail?

B

mamcx
Feb 23, 2013, 07:24 AM
FreePascal work fine in OSX. Lazarus work too, but is the "weak" link. I have used it before. Check this wiki:

http://wiki.freepascal.org/Installing_Lazarus_on_MacOS_X


And pay attention to the details.

eharley
Feb 25, 2013, 10:38 AM
You could just use TurboPascal in DOSBox

http://fuyichin.blogspot.com/2008/04/turbo-pascal-on-dosbox.html

MisterMe
Feb 25, 2013, 06:42 PM
i would like to use pascal under mountain lion.in windows i used a program who looked like this.
http://progopedia.com/static/upload_img/2009/12/07/tp7.png
i tryed lazarus(installed xcode,fpc ,fpc sources) and still dosen't work propertly for me.what should i use?or,how do i make it work? or what other similar programs are for pascal?
i'm using mountain lion 10.8.2.You are not taking Pascal to learn programming. You are taking Pascal for a grade on your transcript. This being the case, you need a compiler at home on which you can complete your homework. If you are running Turbo Pascal on your Windows computer at school, then you need to run Turbo Pascal from the MS-DOS command line on either a Windows computer or virtual environment.

Here is the problem. There were published Pascal standards. However, few of the popular Pascal compilers complied with them. Turbo Pascal was among the least standards-compliant compilers extant. If your teacher is using Turbo Pascal, then you can bet that he/she expects your assignments to be completed in Turbo Pascal. He/She has to grade your work as well as the work of every other student in your class. If the teacher is willing to grade submitted assignments that have been coded for each student's choice of compiler, then more power to him/her. Somehow, I don't think that this is the case.

green.apple
Feb 26, 2013, 03:06 AM
no,it's not the case.i need same compiler with that.why wouldn't lazarus do the trick?

knightlie
Feb 26, 2013, 04:24 AM
It looks like Ebarcadero will let you download Turbo Pascal 5.5: http://edn.embarcadero.com/article/20803 This may run under Wine, or DOSBox.

Man, do I miss Turbo Pascal... :-(

kaydell.leavitt
Feb 26, 2013, 11:21 PM
I'm using Gnu Pascal from the Mac OS X command-line. You can edit files with your favorite Mac text editor (such as TextWrangler).

You can google for "Gnu Pascal Download". It will run under Mac OS X without doing something weird that makes you run Windows under Mac.

And you can google for "Text Wrangler Download"

Both Gnu Pascal and Text Wrangler are totally free.

Pascal isn't a bad first language to learn. That's what it was designed for was to teach student's how to program. But, yeah, for serious programming of a Mac, Objective-C is the best.