Jump to content

How to make AdlibEnable "Global" working ?


Recommended Posts

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

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

  • Developers

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

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

@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

Link to comment
Share on other sites

  • Developers

@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 !!!!!

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

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