drizzlx Posted February 18, 2011 Share Posted February 18, 2011 I have a function and am trying to return a value. However, I get an error. Is this the right format or am I coding wrong? Func funcname() ---code goes here--- Return $result[1] It errors out at the return. However, if I say just Return $result it's fine but does not give me the correct value of course. I need it to Return $result[1]. Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted February 18, 2011 Developers Share Posted February 18, 2011 ... and how is the array value set? ($result[1]) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
drizzlx Posted February 18, 2011 Author Share Posted February 18, 2011 (edited) The value is coming from another function executed within that function. It's an integer. If i just do MsgBox(0, "Value is:", "" & $result[1] & ".") it shows my the value of $result[1]. But I need to return it, not show it. Edited February 18, 2011 by drizzlx Link to comment Share on other sites More sharing options...
Developers Jos Posted February 18, 2011 Developers Share Posted February 18, 2011 (edited) The value is coming from another functions executed within that function. It's an integer.Show some code that fails so we can have a look at it.Also the error you are getting would be helpful. Edited February 18, 2011 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
drizzlx Posted February 19, 2011 Author Share Posted February 19, 2011 Thanks for replying, I figured out what the problem was. I forgot to declare a variable Global that the functions was using and it was initially set to 0. I can't explain it but it works fine now lol. I'm still new with autoit, trial and error! 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