Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 简单的函数问题,如何处理参数_User Interface_Autohotkey - Fatal编程技术网

User interface 简单的函数问题,如何处理参数

User interface 简单的函数问题,如何处理参数,user-interface,autohotkey,User Interface,Autohotkey,我编写了一个脚本,我使用一个超级基本的gui来跟踪正在发生的事情。 因为我用它记录每一个步骤,所以我的代码被gui等弄得乱七八糟,我想把它清理干净 因此,不是每次我都用以下方法做一些事情: Gui Destroy Gui, +AlwaysOnTop +Disabled -SysMenu +Owner ; +Owner avoids a taskbar button. Gui, Add, Text,, script is starting now Gui, Show, x-500 y400

我编写了一个脚本,我使用一个超级基本的gui来跟踪正在发生的事情。 因为我用它记录每一个步骤,所以我的代码被gui等弄得乱七八糟,我想把它清理干净

因此,不是每次我都用以下方法做一些事情:

Gui Destroy
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner  ; +Owner avoids a taskbar   button.
Gui, Add, Text,, script is starting now
Gui, Show, x-500 y400 NoActivate  ; NoActivate avoids deactivating the currently active window.
我想使用一个函数来调用gui,并给它消息以显示如下内容:

infodisplay(hello world)


infodisplay(msg) 
{
Gui Destroy
Gui, +AlwaysOnTop +Disabled -SysMenu +Owner  ; +Owner avoids a taskbar button.
Gui, Add, Text,, msg
Gui, Show, x-500 y400 NoActivate  ; NoActivate avoids deactivating the currently active window.
}
但是,与hello world的文本字段不同,我得到了一个带有msg的文本字段:我阅读了两次帮助文件,但我真的不知道如何处理函数

我能用这个吗?这样行吗?这个想法是

some code ....
infodisplay(step 1)

more code
infodisplay(step 2)
使用%s

你可能想调查一下

对于gui的编辑,您可能也会感兴趣


最棒的是,

如果我使用%msg%,文本字段是空的,但我用一个简单的GUI控件解决了我的问题:谢谢
infodisplay(msg) 
{
    Gui Destroy
    Gui, +AlwaysOnTop +Disabled -SysMenu +Owner  ; +Owner avoids a taskbar button.
    Gui, Add, Text,, %msg%