Jump to content

Retrieving option settings


Guest aallison
 Share

Recommended Posts

Guest aallison

I want to be able to temporarily set an option inside a function:

Opt("SendKeyDelay", 5)

But, I would like to first store the current value for this option in a variable:

Dim $optVal = GetOptValSomehow()

Opt("SendKeyDelay", 5)

So I can reset it after I'm finished

Dim $optVal = GetOptValSomehow()

Opt("SendKeyDelay", 5)

;Do my stuff here

Opt("SendKeyDelay", $optVal)

Any ideas? This is probably something simple I've overlooked.

Thanks

Link to comment
Share on other sites

In the latest unstable, Opt returns the last value for the option. So you could ...

Func DoStuff()
   Local $optVal = Opt("SendKeyDelay", 5)
   ;Do my stuff here
   Opt("SendKeyDelay", $optVal)
EndFunc

This does not appear to work in the latest relase version, just the unstable.

Edited by Nutster

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

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...