| | |
Select Case problem
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2007
Posts: 60
Reputation:
Solved Threads: 0
Lets say now i want to use Select Case For some purposes as shown below:
Here, i have two arrays, One is called strmac() and another one is mac().
strmac() is used to store the variable read from the database, it is used to read the Machine ID for example.
mac() is an array used to read the machine ID as well from the INI file.
For example, if lets say i want to loop through the database, first of all i need to go through the INI file first. If mac() has 3 elements of 123,134,144, then only these 3 machine ID will be selected when it read through the database.
Now;
The problem is, the code is very long because within each case, i still have many calculations and array which is used to store the count for each hour and it just follow some kind of format. And the size of mac() may changes time to time? Any concern to get it simpler? Thanks.....
Here, i have two arrays, One is called strmac() and another one is mac().
strmac() is used to store the variable read from the database, it is used to read the Machine ID for example.
mac() is an array used to read the machine ID as well from the INI file.
For example, if lets say i want to loop through the database, first of all i need to go through the INI file first. If mac() has 3 elements of 123,134,144, then only these 3 machine ID will be selected when it read through the database.
Now;
VB.NET Syntax (Toggle Plain Text)
Do While Not rs.EOF() Select Case (strmac) Case " mac(0) " 'Split it to 24 hours so that i can get the quantity for each hour Case " mac(1) " 'Do whatever code here ......
The problem is, the code is very long because within each case, i still have many calculations and array which is used to store the count for each hour and it just follow some kind of format. And the size of mac() may changes time to time? Any concern to get it simpler? Thanks.....
You could make each case it's own function
Make sense?
VB.NET Syntax (Toggle Plain Text)
Case mac(0) RT_Mac_0 Case mac(1) RT_Mac_1 End Sub.. Public Sub RT_Mac_0 Do whatever you want End Sub Public Sub RT_Mac_1 Do whatever you want End Sub
--
"Dummy."
"Dummy."
![]() |
Similar Threads
- Contactless Card Reader problem (VB.NET)
- Array problem... (C)
- problem with calling a function (C++)
- Weird ASP/SQL Problem (ASP)
- Problem in passing parameters (Visual Basic 4 / 5 / 6)
- wav file problem (Visual Basic 4 / 5 / 6)
- Defining Variable problem (Visual Basic 4 / 5 / 6)
- Problem Downloading large files (ASP)
Other Threads in the VB.NET Forum
- Previous Thread: textbox validation
- Next Thread: Backup an access database
Views: 1142 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application array arrays basic bing button buttons c# center check checkbox code convert crystalreport data database datagrid datagridview date design designer dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert installer intel internet listview mobile monitor net networking objects output panel passingparameters picturebox port position print printing problem read remove save searchbox searchvb.net select serial shutdown soap sorting studio survey table tcp temperature text textbox time timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





