Global command documentation

Blitz3D Forums/Blitz3D Beginners Area/Global command documentation

Bucky(Posted 2003) [#1]
Could anyone point me in the direction of some documentation on the GLOBAL command .

I have looked in my b3d manual, the online help and krylar's book on 2d game making but can't find any. Or I am blind.

Thanks for any help in advance,
Bucky


simonh(Posted 2003) [#2]
No, I'm afraid Global isn't documented at the moment, it's one that has seemingly slipped through the net. It will be fixed shorty.


simonh(Posted 2003) [#3]
Found an old command doc for Global:

Command Name:
Global

Syntax:
Global variable

Definition:
Declares global variables for use with your program.

Parameters:
variable = any valid variable/TYPE name

Description:
There are two types of variables in Blitz Basic; local variables and global variables. Global variables can be utilized anywhere in your program (i.e. the main program look and all functions. Use global variables when you need to track a value across your entire program (player score, lives, etc). You can also define TYPEs as global as well.

Example:
Global player1score ; Declare player's score as global
Global graph.Cursor ; Declare the Cursor TYPE as global



Floyd(Posted 2003) [#4]
Seems to be missing from the index.

In the Blitz IDE you can position the cursor on a word in your source code and press F1 twice to see the help.

I would think most programming books and web sites would tell you about Global and Local variables.
Look for anything that mentions the 'scope' of variables.
You don't have to restrict yourself to Blitz-specific material.


Bucky(Posted 2003) [#5]
Thanks for the help guys : >

Cheers Bucky