|
|||||||
global variables / глобальные переменные
Время создания: 22.04.2017 19:18
Раздел: AutoHotkey - variables
Запись: xintrea/mytetra_db_mcold/master/base/14928779270bwv7nmldo/text.html на raw.githubusercontent.com
|
|||||||
|
|||||||
LogToFile(TextToLog) { global LogFileName ; This global variable was previously given a value somewhere outside this function. FileAppend, %TextToLog%`n, %LogFileName% } Assume-global mode: If a function needs to access or create a large number of global variables, it can be defined to assume that all its variables are global (except its parameters) by making its first line either the word "global" or the declaration of a local variable. For example: SetDefaults() { global ; This word may be omitted if the first line of this function will be something like "local MyVar". MyGlobal := 33 ; Assigns 33 to a global variable, first creating the variable if necessary. local x, y:=0, z ; Local variables must be declared in this mode, otherwise they would be assumed global. } |
|||||||
Так же в этом разделе:
|
|||||||
|
|||||||
|