Jump to content
Sign in to follow this  
Fraggle

How to make AdlibEnable "Global" working ?

Recommended Posts

Fraggle

Hi all,

is it possible to make a the AdlibEnable("Funcname") global to interrupt every called function ?

AdlibEnable seems to work only within the first while loop,

if this func call another function within the while loop, adlib doesnt work anymore...

if I call them by hotkey all is fine

i guess a while loop blocks it cause if i use a hotkey to call Select() it works again.

but i wont use hotkeys so how can i make the adlib work always or to exit a while loop by another func

maybe this little example makes it more clear

; example script only to make the problem clear
AdlibEnable("checkstatus")

; adlib works here
while 1
   Sleep(100)
Wend

;here adlib doesnt work anymore, i cant go back to select()
;cause checkstatus() doesnt seemt to be called anymore
Func _F1()
  While XYZ
     blablablas
  Wend
EndFunc

;here adlib doesnt work anymore, i cant go back to select()
;cause checkstatus() doesnt seemt to be called anymore
Func _F2()
   While ZYX
       blablalbalba
   WEnd
EndFunc

; Adlib works here too ( i can cancel and open select() as much as i want or need)
Func select()
GUI blablabla; this function create some buttons that call another func
   While 1
   $msg = GUIGetMsg()
 Select
   case click1 
      _F1()
      ExitLoop
   case click2
      _F2()
    ExitLoop
  EndSeledct
 Wend
EndFunc


Func checkstatus()
if blablabla then
 select()
else
 blablalal
endif
EndFunc

Share this post


Link to post
Share on other sites
steveR

I don't think it's possible to have multiple functions running at the same time.

Maybe you could put the each function in a seperate script, and have a "master script" checking the status and running the other scripts when needed


AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.

Share this post


Link to post
Share on other sites
Jos

Hi all,

is it possible to make a the AdlibEnable("Funcname") global to interrupt every called function ?

AdlibEnable seems to work only within the first while loop,

if this func call another function within the while loop, adlib doesnt work anymore...

if I call them by hotkey all is fine

i guess a while loop blocks it cause if i use a hotkey to call Select() it works again.

but i wont use hotkeys so how can i make the adlib work always or to exit a while loop by another func

maybe this little example makes it more clear

<{POST_SNAPBACK}>

I guess you are asking if Adlib call itself recursively ... i don't think it would be a good idea.

When the Adlib functions is called and still running it really shouldn't be calling itself again .....


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

Share this post


Link to post
Share on other sites
MHz

I would not use keywords as function names.

Share this post


Link to post
Share on other sites
Fraggle

@steveR: i dont want multiple function running at the same time.

i want only one function running at the same time BUT always adlib running too

even the first function called another one

is it possible to incluse the other scripts and compile them all togehter to just one file ?

@JdeB: i dont want adlib call it self, i only want it nonstop running

@MHz: of course not, as i wrote it is a example to help you understand what i mean and what the functions are supposed to do

Share this post


Link to post
Share on other sites
Jos

@steveR: i dont want multiple function running at the same time.

i want only one function running at the same time BUT always adlib running too

even the first function called another one

is it possible to incluse the other scripts and compile them all togehter to just one file ?

@JdeB: i dont want adlib call it self, i only want it nonstop running

@MHz: of course not, as i wrote it is a example to help you understand what i mean and what the functions are supposed to do

<{POST_SNAPBACK}>

Your AdLb function calls CheckStatus, which Calls Select.

So CheckStatus doesnot end until Select() ends !!!!!


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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.