
-----------------------------------
brl1995
Sun Apr 01, 2012 7:23 pm

Switch Statment with a variable number of cases
-----------------------------------
Hi, i was wondering if it would be possible to create a switch statment that has a variable number of cases based on input from the user earlier. 

i am using this for a  program that creates and handles a number of databases,  so if 5 databases were created last time the program ran the switch would have 6 cases (1 for creating a new database and 5 for editing the existing ones). (the tasks preformed by the different cases would be the same)

So is there any way to do this? my only idea was using a for loop and doing somthing like this:

switch (databases)
{
         for (i = 0; i 