Download the OVAL demo 


This demonstration version of OVAL is fully working and includes all the controls, tools and
documentation that accompany the commercial version. The only restriction is that you can use
a maximum of two forms and two modules in each project.


Important: You will need a Psion Series 3c or a Workabout with version 2 ROM in order to use
OVAL. Neither this demonstration version nor the commercial version of OVAL will run on the
Series 3a, Siena or Workabout version 1.

System requirements:

A PC with 80486 or higher 
VGA display 
8Mb of RAM 
3Mb disk space 
Windows 3.1, Windows for Workgroups, Windows NT 3.5 or higher, OS/2 2.1 or higher, or
Windows 95 
Psion Series 3c or Workabout 


To run your projects on the Psion computer you will need a link cable to connect it to the PC.

Please read the licence agreement before using.


Instructions

When you have downloaded the program OVALDEMO.EXE, simply run it. The OVAL demo package will
unzip itself into the necessary files. Now run SETUP.EXE and follow the on-screen instructions
to install the demo.


Release notes

This version (28 January 1997) fixes a minor problem which occurred if your PC was set up to
use a comma as the decimal separator. It also includes the files required to correct a problem
with the DBS server.



OVAL Tips 

Here are some tips describing useful features of OVAL. 

Resources
Using resources will make it much easier to produce foreign versions of your application. They
can also reduce the amount of code in your application. For example:

Replace code like:


    ChoiceList1.AddItem "One"
    ChoiceList1.AddItem "Two"
    ChoiceList1.AddItem "Three"
    ChoiceList1.AddItem "Four"
    ChoiceList1.AddItem "Five"


with:


   For i=0 To 4
       ChoiceList1.AddItem LoadString(IDS_ONE+i)
   Next i


and add the strings in the String Resource Editor.


Control Arrays
To make a control array set the Index property of a control. Control array elements are exactly
like ordinary controls except they share the same code. Try creating three EditBoxes; each
should have the name property set to "EditBox" and the index property set to 0,1,2. Then a
quick way of resetting your EditBox array would be. 

for i=0 to 2
    EditBox(i).Text = ""
next i


Control arrays are a very powerful and flexible feature of OVAL that you can use to create
professional-looking forms.

Viewports
OVAL can handle forms that are bigger than the Psion's screen; the screen then becomes a
'window', or viewport, onto the form, which scrolls around as the user navigates around the
form. Viewports are created automatically just by making a form bigger than the screen size.
The viewport with the currently selected control is the viewport shown. A ViewportChanged event
is fired every time the current viewport changes.


Types
Unlike OPL, OVAL has user-defined types. A user-defined type looks like this: 

Type People
    String Name
    String Address
    Double DOB
End Type


You can then use this type as part of the OVAL language: 

Dim Foo as People

Foo.Name="Dave Smith"
Foo.Address="Swindon"
Foo.DOB=#12/12/1970#


File handling with user-defined types
You can make file-handling operations easy by using user-defined types as records in a file.

To open a file use:

Open "M:\People.p" For Random As #1 Len = Len(People)


To read a record use:

Get #1, Position, Person

and to write a record use:

Put #1, Position, Person

...where Position is the place in the file you want to put the record.

To close the file use:

Close #1


Creating Controls
Control arrays can be used to add extra flexibility to your forms. You can dynamically create
and destroy controls as required by your program.

To do this first create a control (say an EditBox) and set its Index property to 0.

You can now create another EditBox with the code:

Load EditBox(1)

You then need to set the position of your new EditBox and make it visible: 

EditBox(1).Move(10,100,200,15)
EditBox(1).TabStop=EditBox(0).TabStop+1
EditBox(1).Visible=True

If you then want to get rid of the EditBox: 
Unload EditBox(1)


Control Object

Draw an EditBox, a Label, a Number editor and a Timer Editor on a Form.

What does this code do? (Try it!)

Sub Form1_Load ()
Dim c(4) as control
Dim i as Integer
    set c(1)=EditBox1
    set c(2)=Number1
    set c(3)=Label1
    set c(4)=TimeEdit1
    for i=1 to 4
        c(i).Left=10
        c(i).Top=i*20
        c(i).TabIndex=i-1
    next i
End Sub


The GC object
The GC object offers you direct access to the Psion's powerful graphics facilities.
Here's how it's used: 


Dim tgc As New gc                        ' Declare a GC object
    tgc.CreateGC Hwnd                    ' Create a graphics context
    tgc.Grey = Rnd * 2                   ' Set the grey mode
    tgc.At Rnd * 480, Rnd * 160          ' go to a random position
    tgc.Fill Rnd * 80, Rnd * 40, Rnd * 2 ' Fill a random rectangle
    tgc.FreeGC                           ' Important: every createGC
                                         ' must be followed by a FreeGC


The Tag property
Every control has a Tag property which you can use to store valuable information on your
control.
A common use for the Tag property is to store the type of the control in the Tag. When you
reference it generically (via the Controls collection, for example) you know what control it
is. e.g. 

Dim c(2) as control
set c(1)=EditBox1
c(1).Tag="EditBox"
set c(2)=Number1
c(2).Tag="Number"
for i = 1 to 2
	select case c(i)
		case "EditBox"
			MsgBox "This control is an edit box"
		case "Number"
			MsgBox "This control is a number"
	end select
next i


Comments and suggestions to Gareth-Richards@Psion.com
