Jump to content

Return $result[1] Error


drizzlx
 Share

Recommended Posts

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

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
Link to comment
Share on other sites

  • Developers

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

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

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

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
 Share

  • Recently Browsing   0 members

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