I know variables are defined like this:
local int var1;
but I sometimes see this:
local int var1, var2;
Anyone can tell me what use this has?
variables
- Feralidragon
- Godlike
- Posts: 5493
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: variables
In the first one you are declaring 1 local variable of the type "int".
In the second one you are declaring 2 local variables of the type "int".
So basically the usage is to declare more than 1 variable of the same type.
Quick example:
Can also be declared as:
In the second one you are declaring 2 local variables of the type "int".
So basically the usage is to declare more than 1 variable of the same type.
Quick example:
Code: Select all
local int var1;
local int var2;
local int var3;
local string var4;
local string var5;
Code: Select all
local int var1, var2, var3;
local string var4, var5;
-
- Godlike
- Posts: 3774
- Joined: Fri Jan 14, 2011 1:53 pm
- Personal rank: -Retired-
Re: variables
It is, he's not telling you the 'secret' stuff. That costs extra
So long, and thanks for all the fish