Please ensure you have the latest version (1.4 or above) of the RMREvent example program before reading through this tutorial. If you use an older version, some of the text may not make sense.
Welcome! You've worked through all 19 lessons in the first part of this on-line course and should now have a pretty good grasp of the basics of writing simple programs. If you're an OPL/16 programmer (Siena/3a/3c etc), make sure you read my reasons for going OPL/32 only for the next few months.
Rather than keep adding piece-meal bells and whistles to our little MiLo lottery program, I feel it's important to take a stage back and learn how to write programs 'properly'. What do I mean by 'properly'? Well, off the top of my head:
Building all the above functions up from scratch would be rather tricky, especially for beginners, and it will help enormously to start with some OPL/32 code that works properly and explain how it works. Enter Alan Richey (well known for his 'Bank' series of programs) with his RMR Event demo application. Before going any further, click on the banner at the very top of this page and download the latest version of RMR Event from the RMR web site.
Once we've understood how and why RMR Event works (might take a while!), we'll add in functions of our own to form a fully functional application that you can use in daily life.
Hopefully you've grabbed RMR Event from Alan's web site by now. Stick
the .OPL and .ICN files in any convenient folder and the .MBM and
.HLP files in \System\Apps\RMREvent (you may have to create this folder first), ready for
action. Tap on the RMREvent.opl file and open up the file:
Don't worry about the program's contents for now. Just translate it as usual and run it. You should see the following screen:
Well done. Looks professional, doesn't it? "RMR Event" is now installed
and we're ready to start dissecting it to learn its secrets. There's one
enormous difference that you'll have noticed already from our simple MiLo
example. Whereas the latter started with PROC myfirst: and produced a file that ended
in .OPO in the current folder, RMR Event includes a section starting APP
and ending ENDA and produces .APP and .AIF files in the \System\Apps\RMREvent
folder. And wonder of wonders, it also manages to appear on the Extras bar!
Clever stuff, and this is of course how 99% of professional programs
also work. The APP...ENDA section stands for Application...EndApplication and any lines between them
are to tell OPL any other handy information that's relevant, such as which icon
file to use for the Extras bar and whether the system screen should be able to
create new files for the program. We'll cover the possible options for this
section in the next lesson, but in the meantime pop back to the system screen,
tap on the "New file" toolbar button and note that RMREvent is now installed in
the list of possible applications.
An aside before signing off for this week. Make sure you have a good OPL/32 reference book handy for the next few weeks. It's essential (even for experienced programmers) to have a reminder of the different parameters that each command takes. I use EMCC's "Programming Psion Computers" book, but you can also print off the OPL/32 manual on the PsiWin CD if you want something that doesn't cost £30.
Next week, we'll delve into the fun world of icons, flags and file types. See you then!
Go to next lesson | Programming index