Jump to content

Recommended Posts

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
Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...