mooboo Posted March 15, 2004 Share Posted March 15, 2004 How do i add numbers to variables...something like...$var = 0$var + 1 = $var ;overwrite the variable with a new numberIS THIS POSSIBLE???? Link to comment Share on other sites More sharing options...
Somerset Posted March 15, 2004 Share Posted March 15, 2004 $var = 0 $var = 1 + 0 you have to put the varible first then the equasion... $var = 2 * 2 etc......... and yes you also can add varibles together if they both are numbers... Link to comment Share on other sites More sharing options...
scriptkitty Posted March 15, 2004 Share Posted March 15, 2004 You almost had it the first time. $var = 0 $var = $var + 1;overwrite the variable with a new number one higher AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
CyberSlug Posted March 15, 2004 Share Posted March 15, 2004 (edited) I'll add my 2 cents:$var = 0 is an example of an assignment statement.In (almost) all programming languages, a single variable must appear on the left side of the equal sign. The right hand side can contain variables or literal strings/numbers.0 = $var IS INVALID because the left-hand side is not a variable.$var + 1 = $var is invalid for a simlar reason.$var = $var is fine, although not very useful. [Technical note: $var is being used two diffrent ways in this example. The left $var (L-value) is a variable being assigned to; the right $var (R-value) is a variable being read. Or something like that--I'm a little rusty on all the technical stuff....]$foo = $bar ;This means take the value stored in $bar and assign it to a variable named $foo.Hope that helps Edited March 15, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now