[AccessD] Slightly OT: VBScript Short-Circuit logic?

Bobby Heid bheid at appdevgrp.com
Tue Dec 23 12:03:43 CST 2003


VB.NET uses short circuit logic, but it is the first MS VB to do so.

Bobby

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim DeMarco
Sent: Tuesday, December 23, 2003 12:29 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Slightly OT: VBScript Short-Circuit logic?


The answer to your question is no.  Any thing you pass into OR is going to
be evaluated (same is true in VB/VBA).

Try this code in VBA:

<snip>
Dim blnYes

    blnYes = True
    If blnYes Or CInt(70000) Then
        MsgBox "hi"
    End If
</snip>

You're going to get an overflow error even though blnYes = True.

HTH,

Jim DeMarco



More information about the AccessD mailing list