作者: Banane 最近更新时间: 20100204
This library provides functions to use one single variable as a stack.
You're able to push (add to the stack), pop (remove last added entry and return value) and peek (return last added entry's value).
Could be useful for a small interpreter, calculator and such.
ST_Convert(Value,Mode=0)
ST_Debug(OnOff="")
ST_Del(ByRef Stack)
ST_Dim(ByRef Stack)
ST_IsValid(ByRef Stack,Dim=0)
ST_Len(ByRef Stack)
ST_Peek(ByRef Stack)
ST_Pop(ByRef Stack)
ST_Push(ByRef Stack,Value)
ST_Undim(ByRef Stack)
关于函数的参数和返回值, 请参阅其源码或 此文档.
Because there is no documentation available, I decided to extract related information from source file.
关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=54153
不存在
; #Include st.ahk #NoEnv SendMode Input SetWorkingDir %A_ScriptDir% ;Declare our new stack ST_Dim(Script) ;Create our sample gui, which adds entrys to the stack Gui, 1:+ToolWindow Gui, 1:Add, Edit, x5 y5 w350 h20 vEdit Gui, 1:Add, Edit, x5 y30 w350 h65 +ReadOnly vAll Gui, 1:Add, Text, x5 y105 w100 h15 vCount Gui, 1:Add, Button, x250 y105 w50 h20 gRun, Show Gui, 1:Add, Button, x305 y105 w50 h20 gAdd, Add Gui, 1:Show, w360 h130, Stack Example Return Add: ;Retrieve edit content GuiControlGet, Edit, 1: ;Clear edit GuiControl, 1:, Edit, ;Add to stack ST_Push(Script,Edit) ;Update count text GuiControl, 1:, Count, % ST_Len(Script) Return Run: ;Loop trough the stack Loop, % ST_Len(Script) { ;Retrieve current contents GuiControlGet, All, 1: ;Add new value to old contents GuiControl, 1:, All, % All . ST_Pop(Script) . "`n" ;Update count text GuiControl, 1:, Count, % ST_Len(Script) } Return GuiClose: ExitApp