Jump to content
Sign in to follow this  

Case and Array

Recommended Posts


I am current generation multiple tabs and controls using for loops and arrays. for example.

while 1
$msg = GuiGetMsg()
Case $msg = $plustabbutton
$tabcount = $tabcount + 1

Func AddTab($tabcount)
$tab = GUICtrlCreateTabitem ("Tab "&$tabcount)
$date[$tabcount] = GuiCtrlCreateDate("Date", 170, 120, 130, 20, $DTS_SHORTDATEFORMAT)

Lets say the user clicks the plustabbutton 3 times. This leaves me with $date[1], $date[2] and $date[3].

What I want to know if how to create a case select that inclused the entire array.

Case $msg = $date[*]; If you get what I meen.

bare in mind that Case $msg = $date[1] or $date[2] or $date[3] wont wort since you can end up with 99+ date array entries.

Share this post

Link to post
Share on other sites

When I try the above suggestion I get a "syntax error"

any more ideas?

Share this post

Link to post
Share on other sites

Don't use the Select Case but just the for next loop.

for $i = 1 to Ubound($date) 
   If  $msg = $date[$i] then
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.