Raised This Month: $ Target: $400
 0% 

variable question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-12-2007 , 15:54   variable question
Reply With Quote #1

is it posible to make a global variable,set a new value of the variable in a function and then test in a new function something with that variable from the first function,here is a example of what i am asking:
Code:
new variable
public test()
{
variable =1
}
public test2()
{
if (variable ==1)
...
}
i know its wron what is did in this code but i dont know how to say
CipryXXX is offline
Send a message via Yahoo to CipryXXX
Drak
Veteran Member
Join Date: Jul 2005
Old 04-12-2007 , 15:56   Re: variable question
Reply With Quote #2

Well of course. You're example code is perfectly fine...
Just try it, instead of having to ask.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
CipryXXX
Junior Member
Join Date: Apr 2007
Location: Romania
Old 04-12-2007 , 16:17   Re: variable question
Reply With Quote #3

u are sayng that if i am setting a value in a function to a global variable , the global varibale is going to take that value from the function and if i am using it again it will have the value from that function?
CipryXXX is offline
Send a message via Yahoo to CipryXXX
Drak
Veteran Member
Join Date: Jul 2005
Old 04-12-2007 , 18:42   Re: variable question
Reply With Quote #4

Yes... What else would global variables do? There accessed by everything.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:42.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode