Launch Pascalit.exe. You get a simple window with a menu. Click on File|New|Empty.
A blank page will result. On it enter the following:
program first; begin write(lcd,'Hi'); end.
In a moment, we'll make something happen. But before we do, let's save your typing.
The machine will invoke the save, anyway, even if you don't. The saving is like any other Windows saving, if you are already familiar with it. But I'll take you through things, just in case:
Click File|Save. This will actually bring up the "Save As" dialog box, because this is the first time you are saving the program you've just typed in. You could just enter "My Program" in the file name box and click "ok", but I'm going to suggest a slight improvement.
You are likely to be in the folder (directory) into which you installed Pascalite. What you see may vary slightly from what I saw, but the first three files I had were Adv_text.pas, Average.pas and Avgarray.pas. I would suggest for the files you create making a folder within that folder. In Windows 98, you can simply put the mouse pointer among the file names and right click. Then select "New", "Folder", and give it some suitable name, e.g. "My Pascalite Prgms". There's also an icon you can use for creating a new folder: A folder with a radiating star on the upper right corner.
Double click on the new folder, once created, to move into that folder. Assign a name for the file, I'd suggest "First", or "PLT1ap". (PascalLite Tutorial 1ap, which is the name of the web page you are reading.) Click "Save".
(A little aside for people very new to Windows. The following is true not only for Pascalite, but for most Windows applications. If you've started something from scratch, i.e. by using File|New, then the first time you save it, you get the "Save As" dialog, as I've already said. From that point on, if you use File|Save, your work is simply saved where ever, and under whatever name you specified during the first save. The previous version of your work is over-written. Also, when you load something pre-existing, then doing File|Save will again simply replace the previous version. If you have been working on something, and you don't want to destroy the previous version, then use File|Save As, and change the name used for saving what you have.)
So... you've typed in the little program I gave you. You've saved your typing.
Now click Tools|Simulate Program (or just press F2.. equivalent.) You may well get an error message, in which case a line of your program will be displayed in red. Find the error, fix it, maybe re-save, and try Tools|Simulate Program again. (The line in red is where the compiler noticed the problem. It is not uncommon for the underlying flaw to be earlier in the program. Often you have failed to end the previous line with a semicolon (;). Not every line ends with a semicolon, but they are easily forgotten.)
Don't be alarmed if it seems that nothing has happened. First you need to tell the program to run. Isn't that what "Tools|Simulate Program" said??? Not exactly... that only switches you out of the program editor into the simulation environment. Once there, you need to click on the green, right pointing, triangle on the simulator toolbar to run the program in the simulator. Even when you do that, our little program doesn't appear to do much. Look carefully at the "Simulator" panel that opens when the system is in simulation mode. Near the bottom, on the left, is a simulated LCD display with the following text: "Pascalite II Pro / (c) Control Plus / V2.50 / 2000". Watch the space just after the "2000" when you click the green "Run Program" triangle- you should see "Hi" appear briefly. That's your program running! (The LCD simulation starts with the copyright message, and after your program has run, the panel clears itself and restores the message... that's why the "Hi" appears so briefly. Don't worry... we can make the computer do things our way!
Just one last little flourish to finish off this first tutorial. You won't finish a real program in one go. Part of learning to program is learning to build something up by degrees. Typically, after typing a start, and clicking Tools|Simulate Program, you'll have to leave the simulator, which will send you back to the editing environment. All you need to do to leave the simulator is click on the red X on the simulator toolbar. Adding a second write line, e.g. "write(lcd,'Bye');" Click Tools|Simulate Program again, see your new masterpiece in action (or fix the typos!) and then pat yourself on the back... you're a programmer.
Just one last little flourish to finish off this first tutorial. You won't finish a real program in one go. Part of learning to program is learning to build something up by degrees. Typically, after typing a start, and clicking Tools|Simulate Program, you'll have to leave the simulator, which will send you back to the editing environment. All you need to do to leave the simulator is click on the red X on the simulator toolbar. Adding a second write line, specifically write(lcd,'Bye'); Click Tools|Simulate Program again, see your new masterpiece in action (or fix the typos!) and cheer... you're a programmer!
Oh yes... I said I'd take you through the program....Every Pascal program begins with the word "program". After that, you supply a name; I chose "First" in this case. (PLT1a would have been better, but might have confused you at that stage.) And then the line is finished with a semicolon. You get a lot of semicolons in Pascal. More on them another time.
Next in our simple first program came the word "begin". For every "begin" there is an "end". You can have many begin/end blocks, and they always nest. Leaving out the rest, a complex program might look like.....
begin begin begin end; end; begin begin begin end; begin end; end; end; end.
Did I scare you? I hope not... I wanted you to look forward to the excitement of a really sophisticated project! Anyway. Begins are always paired with ends, as I said. You do NOT put a semicolon after the begin (unusual), but you do put one after the end... usually. (I'll discuss the exceptions another time.) After the final end in a program, you put a period (full stop) instead of the semi-colon.write and writeln are words built into all the Pascals we've been discussing. (A rough equivalent for Delphi, by the way, is "showmessage", e.g. showmessage('Hi');).
Page tested for compliance with INDUSTRY (not MS-only) standards, using the free, publicly accessible validator at validator.w3.org
....... P a g e . . . E n d s .....