Jump to content

how to use a value stored in an array as function name?


Recommended Posts

Short: How could I do something like this:

for $i = 1 to $array1[0]
   func $array2[$i]()
      send($array3[$i])
   endfunc
nextoÝ÷ Ù²èÛ#frêëz{eË
â¶)ಶ§ØZµ©e£-{i¶¬zËhmëÛhj×±¶èqë,x¦bq«b¢w 6^¥§Z¶Ø^¦·¬²Úd{"!j÷¬zÛ©jx§ø¥zØZ¶Ëh­ë[az-ìÙ¨v'âz·(¸§jبƬÁéejËazkjÇ­¡·¬z{S+"'âç¯y«&j|¬yËb¢v¬¶®±êðj{l¦¦W¡×½Õ×®ÏwuoÝ÷ Ûbëa{iÝjºÚÊËh­ë-çîËb¢yÚ벧z¶­yÖò¶ ¶H$^iÔrبÉm×îËb¢v®¶­sbb33c¶'&%³ÒÒ@¢b33c¶'&%³ÒÒFV'0¢b33c¶'&%³%ÒÒvVÆ6öÖP¢b33c¶'&5ÒÒ÷W'70oÝ÷ ٩ݶ·­Ö«­¬¬¶âay§-¹©¢iÛ-¡·¬z{ZºÚ"µÍÌÍØ^LÖÌHH
ÌÍØ^LÖÌWHHXÚÂÌÍØ^LÖÌHHÙHÛÝ[ZÙHÈÙ[ÛÛYH[ÝBÌÍØ^LÖÌ×HH[ÝÈÚ[Ù[oÝ÷ Øazv¬²('d{+%GºÚ"µÍÜ   ÌÍÚHHHÈ ÌÍØ^LVÌBÝÙ^Ù]
    ÌÍØ^LVÉÌÍÚWK ÌÍØ^LÉÌÍÚWJB^oÝ÷ Ûbr(ºWfjG¡¢ÙÊ«¨µª®¢Úîû§rب«¨µ×®Ê®¢Øh¶G²ªê-n«¨¶»§~éܶ*'ªê-Áé¢gªºZØh¶G²ªê-r«¨¶»§~éܶ*'ªê-Ê«²Ê®¢ÑèÁëÞ¬hm«Þ¶¬(!µë-r[r¥uÚ,¢g­)à)¶¬jëh×6for $i = 1 to $array1[0]
   func $array2[$i]()
      send($array3[$i])
   endfunc
next

I kinda feel like I hit a dead end. Is there a kind navigator willing to help me find a way back?

Edited by Sven
Link to comment
Share on other sites

It is hard to help you without a code, but I think this is what you are looking for.

For $i = 1 To $array1[0]
   hotkeyset($array1[$i], '_HotKeyPressed')
Next

Func _HotKeyPressed()
    Local $FoundHotKey = ''
    For $x = 1 To $array1[0]
        If @HotKeyPressed = $array1[$x] Then 
            $FoundHotKey = $x
            ExitLoop
        EndIf
    Next
    If $FoundHotKey = '' Then Return
    Send($array3[$FoundHotKey]) 
EndFunc
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Sorry. Yesterday I tried to post the code, too, but the site seemed down from my place. I'm now back at (boring) work, and as a consequence of that out of the reach of my code :) TGIF

:Edit

Heureka, it's working! Thanks alot!

Edited by Sven
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...