Image Map Image Map
Page 1 of 4 1234 LastLast
Results 1 to 10 of 31

Thread: Turbo Pascal 5.5

  1. #1
    Join Date
    Oct 2016
    Location
    Cincinnati, Ohio USA
    Posts
    242

    Default Turbo Pascal 5.5

    I scored Turbo Padcal 5.5 diskettes off eBay for $9.99, untested. They installed perfectly, so now I am looking for resources to learn how to use it. I used to do some Pascal programming on a Hewlett-Packard engineering workstation that used a Motorola processor, 68000, I think. That was in the mid 80s and wasn't object orientated. I have some books coming, but I think there used to be some sites that had libraries of routines you could download and include in your code. I think that would get me up and running quickly and them modifying them is a good way to learn.

  2. #2
    Join Date
    May 2009
    Location
    Connecticut
    Posts
    3,407
    Blog Entries
    1

    Default

    The documentation is TP 5 is great. I wouldn't race into the OOP features immediately; they weren't fully baked at the time of release. But as a consolidated TP 4 where some of the add ons were included in the main package, TP 5 can't be beat.

    The old Garbo archive has a lot of Turbo Pascal code examples. The mirror I most commonly use seems to be down right now.

    If you didn't order it, the following link is to one of the version of Turbo Pascal Tutor which is helpful in showing some of the differences between Turbo Pascal and standard Pascal. https://archive.org/details/bitsaver...01986_16488828

  3. #3

    Default

    TP 5 is awesome. I used it for years. If you want my advice though, just avoid all the object stuff. I went down that road only to realise that everything can be done just as well with conventional methods.
    Be polite and I may let you live.

  4. #4
    Join Date
    Oct 2016
    Location
    Cincinnati, Ohio USA
    Posts
    242

    Default

    Quote Originally Posted by KC9UDX View Post
    TP 5 is awesome. I used it for years. If you want my advice though, just avoid all the object stuff. I went down that road only to realise that everything can be done just as well with conventional methods.
    Thanks for the advice and links guys. I liked Pascal because it wan't that much different than BASIC, but a lot more structured.

  5. #5

    Default

    Here's what I like about TP and its descendants/imitators::

    There's nothing in the world that can be done in C that you can't do, despite what a lot of people will tell you. And, it's usually easier that C.

    The language is very readable, and fairly consistent. The only thing that is very inconsistent is the inbuilt procecures that allow an undetermined number of parameters. You can't write a procedure like that in TP5.

    It's fairly portable, especially since FPC came about. FPC is almost 100% compatible with TP.

    The compiler is ridiculously fast and makes compact code.

    Pascal is very strict about data types. If you're used to it, it's not a hassle converting types those times when you need to. The rest of the time, it keeps you from making a lot of stupid mistakes.

    Don't overlook some of the rarely used Pascal constructs. Many aren't taught because they don't compare to other languages well. Sets are the first thing that come to mind, but there are others. Custom ordinal types, as well. I use both of those extensively.

    What I don't like about Pascal is that the standard way to format your code, which everyone but me does, is pretty silly. It makes those fancy editors that colour code things almost necessary. I could show you how to write your code in a more organised way, but then you'd have a hard time reading all the examples and things.

    Something that I learned a long time ago that no one emphasises, is that you don't need a semicolon before an END. Get used to not using it, and it can save you from some nesting errors, as well as make ELSE and CASE more natural.

    Code:
      BEGIN
      WriteLn('1');
      WriteLn('2')
      END
    END.
    Be polite and I may let you live.

  6. #6

    Default

    I, too, got a lot of wear out of TP5.5. I further concur the OO stuff in it was ... unnecessary. I never used it for my own programs.
    I use my C128 because I am an ornery, stubborn, retro grouch. -- Bob Masse
    Machine room: http://www.floodgap.com/etc/machines.html

  7. #7
    Join Date
    Jun 2012
    Location
    UK - Worcester
    Posts
    1,455

    Default

    I thought Turbo Pascal was one of the best language packages I ever bought and used.

    I also agree about the OO stuff - avoid like the plague!

    One issue I find with the people I train/mentor is what use the ';' is in the various different languages. C uses it as a statement terminator whereas Pascal uses it as a statement separator. Remember this, and you can identify very quickly whether you need one or not.

    When I learnt Pascal, I found myself putting in the semicolons after every statement in Pascal - and got myself into lots of trouble as a result. I had to learn this lesson myself (and it has served me well) so I pass it on to my trainees.

    I was talking to a sub-contractor only the other week and one of the comments was "I don't know where to put these semicolons in this language" (it wasn't C or Pascal). Oh well, I feel a training course coming along for him shortly!

    Dave

  8. #8
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    4,570
    Blog Entries
    1

    Default

    I'm going to dissent and say that the OOP stuff, once it was finalized in TP 7.0, is actually really great for writing programs that need to create multiple versions of a thing based on user input. For example, I used OOP when I wrote a music program; the multiple output devices all descend from a base output device class, and all each descendent needed to do was change what commands were sent to which ports to generate audio. So instead of something like this:

    Code:
    case outputdevice of:
      adlib:output_adlib(x,y,z);
      SN76496:output_sn76496(x,y,z);
      gmidi:output_gmidi(x,y,z);
    ...
    ...etc., the code only looks like this:

    Code:
    device^.output(x,y,z)
    The benefit (other than readability) is that it is faster; you perform a double memory reference, then the correct code gets called -- this is faster than going through a case statement which is full of jumps and compares.

    Advanced TP programmers are about to say "well, you can do the same thing with function pointers", and they're right. But that's clunky, and it also leads to a lot of compromises: Either you end up duplicating code a lot, or (to save code space) you end up CALLing to the common components and that takes up time.

    Turbo Pascal OOP isn't for everything, or every workload, but it has definitely helped me. I'm working on a hobby project right now that needs to reference a large amount of data, and I wanted it to leverage system RAM, EMS, XMS, or disk space if none of those were available -- and automatically, so I wouldn't have to deal with it differently on different system configurations.. OOP has made that much easier than if I didn't have it.

    So, to be fair, what DON'T I like about OOP in TP?
    • Getting into OOP for the first time takes some getting used to (start by approaching it as "it's a data record with some code attached to it, and you can change what the attached code is during execution if you want to")
    • The virtual method table increases the .exe size anywhere between 5-30% depending on how much of your code uses objects. (It compresses well, so you can compress the .exe and get a lot of space back, but it still takes up space in RAM.)
    • There is a tiny speed penalty calling code in dynamic objects: Instead of a CALL, it's a pointer-load-then-CALL (static objects don't have this penalty, but take up space in the global variable area (data segment))


    To the OP: While you purchased 5.5 disks, I recommend you actually install 7.0; the software and docs are available online through some cursory searches. It has more features, less bugs, outputs faster and smaller code, and has a nicer IDE with more debugging features.
    Offering a bounty for:
    - Documentation and original distribution disks for: Panasonic Sr. Partner, Corona PPC-400, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)
    - Any very old/ugly IBM joystick (such as the Franklin JS-123)

  9. #9

    Default

    I'm going to dissent and say that the OOP stuff, once it was finalized in TP 7.0
    Emphasis mine.

    It was far too undeveloped prior to that for serious usage.
    I use my C128 because I am an ornery, stubborn, retro grouch. -- Bob Masse
    Machine room: http://www.floodgap.com/etc/machines.html

  10. #10
    Join Date
    Aug 2006
    Location
    Chicagoland, Illinois, USA
    Posts
    4,570
    Blog Entries
    1

    Default

    Quote Originally Posted by KC9UDX View Post
    What I don't like about Pascal is that the standard way to format your code, which everyone but me does, is pretty silly.
    The standard, I thought, was 2 spaces indentation, and indenting branches. For example:

    Code:
    var
      num:integer;
    
    begin
      write('Enter a number: ');
      readln(num);
      if (num and 1)=0
        then writeln('Even')
        else writeln('Odd');
    
      case num of
        256:writeln('Number of values a byte can hold');
        6:writeln('6 is afraid of 7');
        7:writeln('because 7 8 9');
      else
        writeln('I have nothing witty to say.');
      end;
    end.
    I adhere to it unless I have multiple statements in my if-then clause; I then switch to the one true brace style:

    Code:
      if (num and 1)=0 then begin
        writeln('something');
        writeln('else');
      end else begin
        writeln('ham');
        writeln('burgers');
      end;
    Is there a problem with this convention? How do you usually format pascal code differently from the above?

    While you can put things on a single line:

    Code:
      if (num and 1)=0 then writeln('Even') else writeln('Odd');
    ...I feel this is a bad practice because it isn't obvious what action/path was taken when you single-step through the code in the debugger.
    Offering a bounty for:
    - Documentation and original distribution disks for: Panasonic Sr. Partner, Corona PPC-400, Zenith Z-160 series
    - Music Construction Set, IBM Music Feature edition (has red sticker on front stating IBM Music Feature)
    - Any very old/ugly IBM joystick (such as the Franklin JS-123)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •