Click here to Skip to main content
15,904,416 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGet list of machines in LAN? Pin
Jimmy Huynh17-Aug-05 16:46
Jimmy Huynh17-Aug-05 16:46 
AnswerRe: Get list of machines in LAN? Pin
Mohamad Al Husseiny17-Aug-05 16:50
Mohamad Al Husseiny17-Aug-05 16:50 
AnswerRe: Get list of machines in LAN? Pin
Steve Pullan17-Aug-05 17:26
Steve Pullan17-Aug-05 17:26 
AnswerRe: Get list of machines in LAN? Pin
Anonymous17-Aug-05 17:54
Anonymous17-Aug-05 17:54 
GeneralCalendar control in Access forms Pin
Anonymous17-Aug-05 12:43
Anonymous17-Aug-05 12:43 
GeneralRe: Calendar control in Access forms Pin
Anonymous17-Aug-05 12:44
Anonymous17-Aug-05 12:44 
GeneralUsing IS in Select Case Pin
dotnetCarpenter17-Aug-05 10:02
dotnetCarpenter17-Aug-05 10:02 
GeneralRe: Using IS in Select Case Pin
Steve Pullan17-Aug-05 15:00
Steve Pullan17-Aug-05 15:00 
Jon,

There are many implicit data type conversions in this code (i.e. double to integer, float etc...). Maybe the erratic behaviour of the Select is caused by this?

My advice is to strictly type each variable and function to ensure that you are comparing similar data types rather than letting the compiler make its best guess at it.

e.g.

<br />
Option Strict On<br />
<br />
    Function selectTest(ByVal intAntal As Integer) As Boolean<br />
<br />
        Select Case (intAntal)<br />
<br />
            Case CInt((30 / 20) * 100), Is >= 100<br />
                selectTest = True<br />
                'Exit Function<br />
<br />
            Case Else<br />
                selectTest = False<br />
<br />
        End Select<br />
<br />
    End Function<br />


Maybe the code in your second example is not stopping at Case 1345, Is > 90 is perhaps the case variable .intAntalPladser is neither 1345 nor > 90; or an exception is being thrown here or in preceeding Case statements. To investigate this, wrap the code in a a Try..Catch block to trap and display any errors.


...Steve
GeneralRe: Using IS in Select Case Pin
dotnetCarpenter22-Aug-05 4:26
dotnetCarpenter22-Aug-05 4:26 
GeneralPrinting Array of Bytes to File Pin
ChemmieBro17-Aug-05 7:55
ChemmieBro17-Aug-05 7:55 
GeneralRe: Printing Array of Bytes to File Pin
BammBamm17-Aug-05 8:49
BammBamm17-Aug-05 8:49 
Generalftp Pin
17-Aug-05 7:54
suss17-Aug-05 7:54 
GeneralRe: ftp Pin
Mohamad Al Husseiny17-Aug-05 16:55
Mohamad Al Husseiny17-Aug-05 16:55 
GeneralVBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:01
FlyngTiger17-Aug-05 7:01 
GeneralRe: VBA call to a vb.net dll Pin
Anonymous17-Aug-05 7:09
Anonymous17-Aug-05 7:09 
GeneralRe: VBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:12
FlyngTiger17-Aug-05 7:12 
GeneralSimple Syntax Issue Pin
Capilano17-Aug-05 5:11
Capilano17-Aug-05 5:11 
GeneralRe: Simple Syntax Issue Pin
Dave Kreskowiak17-Aug-05 5:31
mveDave Kreskowiak17-Aug-05 5:31 
GeneralRe: Simple Syntax Issue Pin
Capilano17-Aug-05 6:46
Capilano17-Aug-05 6:46 
GeneralRe: Simple Syntax Issue Pin
Anonymous17-Aug-05 7:05
Anonymous17-Aug-05 7:05 
GeneralRe: Simple Syntax Issue Pin
Capilano17-Aug-05 7:10
Capilano17-Aug-05 7:10 
GeneralRe: Simple Syntax Issue Pin
Dave Kreskowiak18-Aug-05 4:35
mveDave Kreskowiak18-Aug-05 4:35 
GeneralRe: Simple Syntax Issue Pin
Anonymous18-Aug-05 5:09
Anonymous18-Aug-05 5:09 
GeneralInserting data using web form with less code Pin
User 191970217-Aug-05 4:27
User 191970217-Aug-05 4:27 
GeneralRe: Inserting data using web form with less code Pin
Dave Kreskowiak17-Aug-05 5:29
mveDave Kreskowiak17-Aug-05 5:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.