Sign in to follow this  
Followers 0
theguy

Redefining Char Variables

3 posts in this topic

#1 ·  Posted (edited)

lets say I have the following:

$varA = "Hello";
$varB = "Goodbye";

One()

Func One()
Send ($varA);
Two()
Send ($varA);
EndFunc


Func Two()
$varA = $varB;
EndFunc

I want this to output "Hello", then "Goodbye. But in Func Two() it dosn't seem to take the variable back to Func One. Any help would be greatly appreciated.

Edited by theguy

Share this post


Link to post
Share on other sites



Variables used inside functions are classed by default as LOCAL variables. To use a variable between (and outside) functions you need to do this

GLOBAL $variable

before using the variable.

Share this post


Link to post
Share on other sites

lets say I have the following:

$varA = "Hello";
$varB = "Goodbye";

One()

Func One()
Send ($varA);
Two()
Send (varA);
EndFunc


Func Two()
$varA = $varB;
EndFunc

I want this to output "Hello", then "Goodbye. But in Func Two() it dosn't seem to take the variable back to Func One. Any help would be greatly appreciated.

It is working as you want just put a $varA in the second Send. I don't thing it was the problem you were trying to solve.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0