oxio Posted May 16, 2007 Posted May 16, 2007 hello, im new with autoit so im just playing with it, normaly i do php for my work but i dont know what i do here wrong. #Include <Array.au3> $Data = "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p" $Array = StringSplit($Data,"|") Func ShowMessage($char) MsgBox(4096,"",$char) EndFunc For $element In $Array HotKeySet($element, ShowMessage($element)) Next Sleep(100000) p.s sorry for my bad english its not what it should be
Developers Jos Posted May 16, 2007 Developers Posted May 16, 2007 (edited) hello, im new with autoit so im just playing with it, normaly i do php for my work but i dont know what i do here wrong. #Include <Array.au3> $Data = "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p" $Array = StringSplit($Data,"|") Func ShowMessage($char) MsgBox(4096,"",$char) EndFunc For $element In $Array HotKeySet($element, ShowMessage($element)) Next Sleep(100000) p.s sorry for my bad english its not what it should be Second parameter of HotKeySet() requires a valid Func name defined in a string, not a Func. HotKeySet($element, "ShowMessage") You cannot use parameters in the defined Function when used in HotKeySet(). Edited May 16, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
oxio Posted May 16, 2007 Author Posted May 16, 2007 thanks for your reply but whats a good solution to solve this script then?
Developers Jos Posted May 16, 2007 Developers Posted May 16, 2007 (edited) thanks for your reply but whats a good solution to solve this script then?the @HotKeyPressed macro will contain the key pressed so you can use that in the "called" func. #Include <Array.au3> $Data = "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p" $Array = StringSplit($Data, "|") Func ShowMessage() MsgBox(4096, "", @HotKeyPressed) EndFunc ;==>ShowMessage For $element In $Array HotKeySet($element, "ShowMessage") Next Sleep(100000) Edited May 16, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
PsaltyDS Posted May 16, 2007 Posted May 16, 2007 the @HotKeyPressed macro will contain the key pressed so you can use that in the "called" func. #Include <Array.au3> $Data = "a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p" $Array = StringSplit($Data, "|") Func ShowMessage() MsgBox(4096, "", @HotKeyPressed) EndFunc ;==>ShowMessage For $element In $Array HotKeySet($element, "ShowMessage") Next Sleep(100000)oÝ÷ Ûú®¢×¢Ö^jVîµ+kx¦Xën®{r§¶)ôß +¬´¶Ê¢}ý·§¶Ú¶×¦¦ÛhjË(r&y¡è´§²IëpØR Z+üæk)èµ·æÞ²×è®ØZµªi'¶*'N¬jú"vƵ驶)ඬzØ^r§µ«ìºÚ"µÍÜ ÌÍÙHHHÈ ÌÍÐ^VÌBRÝÙ^TÙ] ÌÍÐ^VÉÌÍÙWK ][ÝÔÚÝÓYÜØYÙI][ÝÊB^ Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now