Pascal Programming

Discussion in 'Mac Programming' started by dbergrude, Feb 23, 2011.

  1. macrumors newbie

    Joined:
    Feb 23, 2011
    #1
    I have an old Pascal basketball stats program that I would like to convert to run in OS X. Its a quick and easy program that works great. Only problem is we have to use old equipment to run it. An emulator would also work, but I need to be able to print from it. Any help or suggestions any of you could provide I would greatly appreciate it. Thanks
     
  2. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
    One of our users (larswik) has actually been taking a Pascal course recently and using his Mac to write the code. There are two Pascal compilers for the Mac that you could consider. GNU Pascal and Free Pascal.

    Does the app have a GUI or is it console/text based?

    B
     
  3. thread starter macrumors newbie

    Joined:
    Feb 23, 2011
    #3
    Its console/text based. All the code entered is 3 digits. If player number 10 scores a 2 pointer its 210, a 3 pointer its 310, if he/she misses its s10. For rebounds its d10 for defensive and r10 for offensive and so on. All players are entered into a team file and you don't have to worry about substitutes either. The great thing is that you don't have to look down to key in the event. So many of the new programs you have to look down and there is too many clicks. We tried one for the iPad and found ourself cheating off of the old system to keep up.

    Thanks for your help.
     
  4. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #4
    So definitely take a look at the larswik Pascal threads. There are plenty of links and instructions there to get you started if you are running into any issues.

    Another option, that wasn't right for larswik would be to use p2c to translate your Pascal source to C and maintain that translated code instead.

    B
     
  5. macrumors 6502

    Joined:
    Apr 29, 2010
    #5
    Sometimes, when I've used p2c, I've needed to revise the C programs my Sun box wrote with it. The changes have been minor,though. For example, I've had to to replace the main() function's arguments with "void".
     
  6. Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #6
    Yeah, that's part of what I was referring to as maintenance.

    The advantage is you get C code out of it which would be easier to compile on random platforms.

    B
     
  7. macrumors 6502

    Joined:
    Apr 29, 2010
    #7
    On the other hand, I think splint made the Sun machine complain about some C statements it wrote with p2c. It's probably safe to ignore the complaints, though.

    By the way, to get splint, a more sophisticated version of Unix's lint command, you need to build it first. It's worth the effort because it'll tell your computer how to find memory leaks, unreachable code, and maybe even an infinite. But run splint on its own source code, and the computer will find something to yell about. Ironic?
     

Share This Page