This wiki is out of date, use the continuation of this wiki instead

Public variable

From FenixWiki

Revision as of 01:14, 18 June 2007 by Sandman (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search


Definition

A public variable is a variable that is specific to a process or function in the same way as a private variable. However, unlike a private variable, a public variable can be accessed from the rest of the program, by use of the ProcessID.

Because of the way the compiler works, public variables are only accessible for processes and functions below the declaration (which in fact is pretty normal). To assist in this matter, the statement Declare was created.

Example

Process SpaceShip
Public
    int speed;
    String name;
Begin
    Loop
        frame;
    End
End

This is for example when a ship is needed, of which the speed and name want to be accessible from the rest of the program. This way, one can easily have multiple instances of the same ProcessType, but still have the appropriate variables easily accessible.

Personal tools