variables

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

variables

Post by Rakiayn »

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?
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: variables

Post by Feralidragon »

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:

Code: Select all

local int var1;
local int var2;
local int var3;
local string var4;
local string var5;
Can also be declared as:

Code: Select all

local int var1, var2, var3;
local string var4, var5;
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: variables

Post by Rakiayn »

thats it?
lol I thought it was something more complex
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: variables

Post by JackGriffin »

It is, he's not telling you the 'secret' stuff. That costs extra :)
So long, and thanks for all the fish
Post Reply