Pascal
All tutorials in Pascal
Sort By:    Name   Rating   Views  Comments    Date 

The people working on the hardware of early computers were delighted when the software people told them that only two states were needed inside the machine. You or I might try to make an analog computer, one that used, say, 1 volt to stand for "1", 2 volts to stand for "2", etc. Making such circuits is possible.... just tedious. It is easier to make circuits which only need to...

Views: 364 Comments: 0

Pascal programs can be structured like that. You can (just about) have a program within a program within a program.... Maybe the following will show you what I mean. I've used slightly odd indenting to help emphasise the point. The program doesn't do anything profound. Don't try to compile the it.

Views: 387 Comments: 0

If you click on the Pascalite menu's File|New, you are offered "New" and "Default". New gives you a blank page; Default gives you a boilerplate for a program which you can build up into something to accomplish whatever you need. This tutorial (less hands-on than most) takes you through the ideas behind the boilerplate.

Views: 286 Comments: 0

This tutorial has less hands on material than usual; it is more theoretical. If you work through it, though, you will be able to write working programs with less trial and error along the road to finding out what is allowed.

Views: 284 Comments: 0

While "types of data" makes sense to anyone, for programmers, especially Pascal programmers, the word type is important. If a variable has been declared to be of, for example, "type" byte, you get a set of advantages and a set of limitations. Accepting these limitations means that it is harder to write programs with bugs, and it is easier for the person who writes the compiler...

Views: 222 Comments: 0

Variables for numbers was a good place to start, but you can store other TYPES of data, and once you know about that, the program we wrote last time can be written more simply. Simple is always good, because it makes your code more clear... helping reveal any mistakes.

Views: 207 Comments: 0

Inside the computer, at one level, everything is numbers. You don't always have to work at such a low level... we have already made the Pascalite display "Hi" without having to worry about the fact that the code for H is 72 and the code for i is 105, for instance... but it pays to be aware that there are numbers inside the machine.

Views: 247 Comments: 0

Forgive a nostalgic digression? As I start this tutorial, I must just pay homage to Per Ranhoff. I can remember extraordinary detail of a day in the late sixties when I age 15, I was sitting in my first computer lesson. Per started us off with the concept of variables. The specific machine he was showing us how to use was the same PDP-8 that he- who- would- become technical director of "Toy...

Views: 227 Comments: 0

The write(lcd,255) line clears the LCD screen. If you said write(lcd,65), an A would appear on the screen, 65 being the ASCII code for "A". Notice there are no apostrophes around the 65. If you wrote write(lcd,'65'), then you would get 65 on the LCD. 255 is what programmers call a rogue value. It is special; it isn't treated like other numbers. Its meaning to the LCD unit is "Clear...

Views: 234 Comments: 0

Pascal's semicolon is a bit like English's period (full stop). Because so many lines in Pascal end with a semicolon, and because putting one before an "else" causes problems, and because if...then...else statements are usually split across two (or more) lines, I still enter similar lines in my programs as follows:

Views: 220 Comments: 0

Everyone: Please make use of the good helpfiles that come with your Pascal! My tutorials are not meant to supplant those, merely to take you through what is there in an easy (I hope) sequence. A useful feature of Pascalite is that if you are editing your program, and you want to look up say, GetTime, in the compiler's helpfile: Just type "GetTime" (without the quotes), leave the cursor...

Views: 227 Comments: 0

nvoke a save, either with alt-F S, or with F2. There is no "Save As", as such, in Turbo Pascal, but the first time you save something, you are given a chance to designate a name for the file. (The equivalent of "Save As" is on the file menu, as "Write to".) You could just enter "My Program" in the file name box and click "ok", but I'm going to...

Views: 202 Comments: 0

A ten-year-old working at home without help should be writing programs in Pascal, using FPC (Free Pascal) after applying him or herself to the following... if I've done it right! For those of you who are NOT new to programming, may I ask you to skim through the "Level One" material anyway? There are some things you might find useful. I'm working on a Windows 98 machine. Windows 95 or the...

Views: 196 Comments: 0