Sign in to follow this  
Followers 0
Guest aallison

Retrieving option settings

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

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