Sunday, 15 July 2012

Getting variable type in Autohotkey -


Why does it work to determine

  if the delay is integer {MsgBox you set delay =% delay% second return} and {Msbiboks "% delay%" is not a valid number GoSub, input}   

but it's not - it also allows non-integer values, when even more than 0

  (if delay is integer and delay & Gt; 0) {MsgBox set delay =% delay% seconds back} of {MsgBox "% delay%" valid number no Is to help GoSub, input}   

means the script both snippets to check the result of an input box to remove the film or STH.

  Delay: = 120 Help =   

Help - Open Auto Auto Extractor `nF1: Help`nF2: Get Open Window`n (being in the foreground must) `Nf3: shell set the delay (seconds, normally 120)` NF4: start or stop unpacking`nF5: Exit MsgBox% Help% F 1 :: MsgBox% Help% gain F2 :: WinGetTitle, title, a MsgBox selected window "% Title%" Back F3 :: Input: InputBox, Delay, Set Extraction End In Seconds .., Use Number Only ,,,,,%,%% delay; InputBox, OutputVar [, title, quick, hide, width, height, first, second, fonts, timed, default] if the delay integer {MsgBox set delay return =% delay% seconds} else {MsgBox "% delay % "is not a valid number Gosub, input} #MaxThreadsPerHotkey 3 F4 :: #MaxThreadsPerHotkey 1 if KeepWinZRunning {KeepWinZRunning: = 0 return} else {KeepWinZRunning: = 1} {loop loop% delay% {sleep 1000 if KeepWinZRunning broke { }} if KeepWinZRunning not {break} ControlSend ,, enter {% title%}} KeepWinZRunning: = 0 return F5 :: ExitApp return

I think this question will answer your question from the autohotkey documentation:

Note: operators are "between", "is", "in" And "included" are not supported

Regardless of this rule for me The second example works fine.

No comments:

Post a Comment