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

Category:Local variables

From FenixWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 13:23, 1 May 2007 (edit)
Sandman (Talk | contribs)
m (category)
← Previous diff
Revision as of 02:29, 12 May 2007 (edit) (undo)
Sandman (Talk | contribs)

Next diff →
Line 1: Line 1:
[[Category:variablecategories]] [[Category:variablecategories]]
-A local variable is a [[variable]] that is specific to a [[process]] in the same way as a [[private variable]]. However, unlike a [[private variable]] it is possible for other processes to use these local variables by means of the [[ProcessID]]. Local variables up to [[Fenix]] version 0.86 are not specific to a particular [[process]] like [[private variables]] but each [[process]] has the same set of local variables which are defined after [[global variables]] following the statement "LOCAL". Note that in most versions of Fenix the first local variable to be defined is bugged and will cause the program to crash if used.+== Definition ==
 +A local variable is a [[variable]] that is specific to a [[process]] in the same way as a [[private variable]]. However, unlike a private variable it is possible for other processes to use these local variables by means of the [[ProcessID]]. Local variables up to [[Fenix]] version [[0.86]] are not specific to a particular process like private variables but each process has the same set of local variables which are defined after [[global variables]] following the statement [[Local]].
 + 
 +Note that in most versions of Fenix the first local variable to be defined is bugged and will cause the program to crash if used. To avoid this, the first local to be declared by the user should not be used, but instead be a garbage variable.
 + 
 +== Example ==
<pre> <pre>
-program example_prog;+Program example;
-const+Const
- int someconstantvariable;+ someconstantvariable;
-global+Global
- int globalint;+ int globalint;
- string globalstring+ string globalstring;
- //etc...+ //etc...
-local+Local
- UNUSED; //this variable is not used as it is bugged+ int UNUSED; //this variable is not used as it is bugged
- //[insert local variables that you can use here]+ //[insert local variables that you can use here]
-begin+Begin
- //rest of program...+ //rest of program...
 +End
</pre> </pre>
-In [[Fenix]] versions 0.86 and later, it is possible to assign [[processes]] specific local variables is the same way that [[local variables]] are assigned:+In Fenix versions 0.86 and later, it is possible to assign processes specific local variables is the same way that local variables are assigned:
<pre> <pre>
-process a_process()+Process example_process()
-private+Private
//some private variables //some private variables
-local+Local
//some local variables //some local variables
-begin+Begin
//rest of code... //rest of code...
 +End
</pre> </pre>
NOTE: There is a restriction with local variables assigned like this in that they can only be used by processes called after the process where they are assigned. NOTE: There is a restriction with local variables assigned like this in that they can only be used by processes called after the process where they are assigned.
-There are also a large number of [[predefined variables]] which are local which can be found in the [[predefined variables]] list.+There are also a number of [[predefined]] local variables which are listed below.

Revision as of 02:29, 12 May 2007


Definition

A local variable is a variable that is specific to a process in the same way as a private variable. However, unlike a private variable it is possible for other processes to use these local variables by means of the ProcessID. Local variables up to Fenix version 0.86 are not specific to a particular process like private variables but each process has the same set of local variables which are defined after global variables following the statement Local.

Note that in most versions of Fenix the first local variable to be defined is bugged and will cause the program to crash if used. To avoid this, the first local to be declared by the user should not be used, but instead be a garbage variable.

Example

Program example;
Const
    someconstantvariable;
Global
    int globalint;
    string globalstring;
    //etc...
Local
    int UNUSED; //this variable is not used as it is bugged
    //[insert local variables that you can use here]
Begin
    //rest of program...
End

In Fenix versions 0.86 and later, it is possible to assign processes specific local variables is the same way that local variables are assigned:

Process example_process()
Private
   //some private variables
Local
   //some local variables
Begin
   //rest of code...
End

NOTE: There is a restriction with local variables assigned like this in that they can only be used by processes called after the process where they are assigned.

There are also a number of predefined local variables which are listed below.


Articles in category "Local variables"

There are 18 articles in this category.

A

B

F

G

I

R

S

S cont.

X

Y

Z

Personal tools