Jump to content

Guigetmsg(), Select Case And An Array


Recommended Posts

Ok I have 192 picture controls on my script. They are all in an array.

How can I make it so I don't have to write 192 Case lines for each control in the array.

Also I want to set $b to the number in the array that was clicked on.

Example

While 1
$msg = GUIGetMsg()

Select
Case $msg = $a[1]
$b = 1
Case $msg = $a[2]
$b = 2
EndSelect
WEnd

While 1
$msg = GUIGetMsg()
Select
Case $msg = $a
$b = ?
EndSelect
WEnd

May sound confusing of what i'm trying to do if you don't understand say so and i'll try to reword.

Link to comment
Share on other sites

not tested

While 1
    $msg = GUIGetMsg()
    For $i = 1 To 192
    Select
        Case $msg = $a[$i]
        $b = $i
    EndSelect
    Next
WEnd

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
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...