Sign in to follow this  
Followers 0
drizzlx

Return $result[1] Error

5 posts in this topic

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!

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by drizzlx

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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!

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