Filtering of menus
Posted on 2012-03-10
I'm working on VB6 and there is a sub function where i have encountered "procedure too large" error, reason is I have to filter the respective selections for individual Profile and it's location and it's hostname. In the end the whole code is a huge chunk of Case loops.
There are 3 variables to consider:
1. Profile (15 in total)
2. Location (35 in total)
3. PC hosts-name (35 in total)
And there are 6 menu selections:
Clicking on the any of the menu will pop up 5~6 selections.
The problem is the selections are filtered by the 3 variables hence the legacy code was something like...
Select Case Profile
Select Case "Location"
If hostsname like "abc" Then
I hope experts can advice on how can i stream line the filtering process without over using Case,If Else loops.