ozbob Posted January 25, 2005 Posted January 25, 2005 I would like to use a variable and after it is used re-use it again but before that it needs to be rest to nothing. When I do the following:dim $test$test="Dummy"msgbox(4096,"",$test)dim $testmsgbox(4096,"",$test)The result is that $test is still comes back with Dummy.In the help file it is stated that Dim for the same variable name will erase and reset the dimensions to the new definition.Please help me out!!!!!!
closeupman Posted January 25, 2005 Posted January 25, 2005 (edited) I would like to use a variable and after it is used re-use it again but before that it needs to be rest to nothing. When I do the following:dim $test$test="Dummy"msgbox(4096,"",$test)dim $testmsgbox(4096,"",$test)The result is that $test is still comes back with Dummy.In the help file it is stated that Dim for the same variable name will erase and reset the dimensions to the new definition.Please help me out!!!!!! <{POST_SNAPBACK}>if it's in the same scope, why not just use $test="" ?EDIT:btw, you interpreted it wrong it says:erase and reset the dimensions to the new definitionDIMENSIONS not VALUE! Edited January 25, 2005 by closeupman
ozbob Posted January 25, 2005 Author Posted January 25, 2005 That is also what I figured out but then I need to set all my variables to "" and with DIM I can just place all my variables after eachtother like: DIM $test, $test1, $test2 and so on.
closeupman Posted January 25, 2005 Posted January 25, 2005 That is also what I figured out but then I need to set all my variables to "" and with DIM I can just place all my variables after eachtother like: DIM $test, $test1, $test2 and so on.<{POST_SNAPBACK}>ya...i think you're out of luck...that resetting I believe applies to arrays also anyways( that's y there's redim and dim, redim preserves values for arrays)The ReDim keyword is similar to Dim, except that ReDim preserves the values in the array instead of removing the values while resizing an arrayBest thing is just $test="" or dim $test="",$test2="" ....or if wanna get fancy and more comprehensible what u're up to:dim $a,$b=6msgbox(0,"",$b,2)$b=_reset()msgbox(0,"",$b,2)func _reset() Return ("")EndFunc
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