Re: [AHK-] 編輯變數名稱(擷取部分)

看板EzHotKey作者 (IV)時間13年前 (2012/07/20 14:21), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
學會表達式賦值,等號賦值請當作不存在。 ==== now := A_now eatapple := 20110718174120 這邊想問eatapple後面的20110718174120是代表 20110718174120是一個變數嗎? 然後eatapple等於20110718174120變數裡面的資料? 如果不是的話要怎麼判斷 := 右邊是數值、變數或是字 串(用""包起來?)呢? : eatbus := 20130718174120 : Happle := 999 : Hbus := 888 : function(x,y) : { : StringTrimLeft, a, x, 3 ;(這裡是想說去掉eat為首的變數名稱) : if (%x% - y <= 0) : { : means:="OK!" : return means : } : else : { : x := "H" . a : x := %x% : return x : } : } : MsgBox,% function("eatapple", now) : MsgBox,% function("eatbus", now) ---------------------------------------------------------------------------- 這裡想再請教兩點 1. 我想在IniWrite指令裡面的參數用變數名稱 像是這樣 now:=A_Now function(xR,yR) { . . . IniWrite,%xR%,test.ini,xR,ready ;(這裡如果用xR打進去的話,會直 接儲存成xR,該怎麼做才能讓他存 成變數名稱(像eatapple)呢?) . . . return xR } msgbox,% function(eatapple,now) ------------------------------------------------------------------------------ 2. 這邊我想要更改Gui介面 Text的 Style 可否能直接把%st%去掉直接放入function呢? Gui, Add, Text,% "x11 y14 w430 h70" . function(eatapple,now) , abcdefghijklmno pqrstuvwxyz st:="" now:=A_Now eatapple := 20110718174120 function(x,y) { if (x-y<=0) { means:="0x1000" return means } else { means:="" return means } } st:=function(eatapple,now) Gui, Add, Text, x11 y14 w430 h70 %st% , abcdefghijklmnopqrstuvwxyz Gui, Show, xcenter ycenter autosize, test window Return GuiClose: ExitApp ------------------------------------------------------------------------ 抱歉問題有點多 先謝謝了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.18.125
文章代碼(AID): #1G2FZk2H (EzHotKey)
文章代碼(AID): #1G2FZk2H (EzHotKey)