Sign in to follow this  
Followers 0
Hello Me You

What is Global?

7 posts in this topic

#1 ·  Posted (edited)

What is that Global in HotKeySet?

Any examples if you can to help me more?

Edited by Hello Me You

Random

Share this post


Link to post
Share on other sites



What is that Global in HotKeySet?

Any examples if you can to help me more?

What is what Global ?

Are you talking about the example ?


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

for example:

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")  ;Shift-Alt-d

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc

what is "Global $Paused"?

Edited by Hello Me You

Random

Share this post


Link to post
Share on other sites

Hi,

$paused is a variable and Global defines the varibale to be accessable in your whole script.

Search for DIM, LOCAL and GLOBAL and you 'll see.

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

what is "Global $Paused"?

Thats nicely explained in the Helpfile, but Variables can have a Local and Global Scope.

Local= only known to the function its in.

Global= Known throughout the whole script.

More details in the Helpfile :whistle:


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

Share this post


Link to post
Share on other sites

Global, "forces creation of the variable in the Global scope" rather than Local, forces creation of the variable in the Local/Function scope.

Hope that helps, otherwise do a search for Dim / Global / Local / Const in the helpfile.

:whistle:

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I already searched in the help file but couldn't understand what it does

Thank for all help: th.meger, JdeB and bert

Edited by Hello Me You

Random

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