Log in

View Full Version : Creating Globals



wantonman
01-17-2012, 07:39 AM
Hi not too sure but i have an example


example:
The use for MSCX and MSCY is soo simple..

it is like a variable you do not have to declare on every function or procedure
:end example


okay now im trying to make a global declaration to use.


Lets say i want to have a variable

var
Zone1: integer;
begin
zone1:= poopie
soo yes


I really want to use that in a way where I do not have to call what "zone1:="
on each function or procedure.



When creating your own includes you may choose to declare "CONST" they are good!

they will always be there.. by looking inside the global.simba file there is all the examples you need ...
also from there you can see all the people who helped.. lol
it is funny to see that all these guys are still here today!
thanks for making a great include MR bananaman!

KingKong
01-17-2012, 08:08 AM
Im confused, what exactly do you want to do? Make a global variable?

Then do it like this:

program new;
var
money: Integer;

procedure printmoney;
begin
writeln(money);
end;

begin
money := 999;
printmoney;
end.

wantonman
01-17-2012, 08:11 AM
I wanted to see how to properly declare a Constant in an include I have created for Pascal or.. is it simba? well its like c++ was made from c? or is simba just the ide gui?

KingKong
01-17-2012, 11:01 AM
yes, simba is the interpreter/ide and the programming language used to script is called pascalscript(a variant of pascal?). If you want to declare a constant in an include file, then all you do is this:

const
const1 = 55;
const2 = 'hi!';


After that you save it and include it inside the main script.
Note: Include files are basically contain a list of functions/procs/vars/consts that are 'held' in place and the main script includes them and uses them, so that the actual script isn't that big. Also, include files don't have a begin...end.

wantonman
01-17-2012, 09:01 PM
hey king kong do you know how to make global bitmaps as well? i couldent understand it when i was looking through srl includes