Function name | VB 6 [1] [2] | VBA [3] | VBScript [4] | VB .NET | T-SQL |
---|---|---|---|---|---|
IsArray | Yes | Yes | Yes | Yes | No |
IsDate | Yes | Yes | Yes | Yes | Yes |
IsDBNull | No | No | No | Yes | No |
IsEmpty | Yes | Yes | Yes | No | No |
IsError | Yes | Yes | No | Yes | No |
IsMissing | Yes | Yes | No | No | No |
IsNothing | No | No | No | Yes | No |
IsNull | Yes | Yes | Yes | No | Yes |
IsNumeric | Yes | Yes | Yes | Yes | Yes |
IsObject | Yes | Yes | Yes | No | No |
IsReference | No | No | No | Yes | No |
The Is
functions (also known as data information functions, [5] data inspection functions, [6] or data-testing functions [6] ) are a set of functions in Microsoft's Visual Basic 6, Visual Basic for Applications, VBScript, and Visual Basic .NET. Several of them are also provided in Transact-SQL by the .NET Framework Data Provider for Microsoft SQL Server.
The functions are simple data validation and data type checking functions. The data validation functions determine whether it is possible to convert or coerce the data value given as an argument to the function to the type implied by the function name, and return a Boolean
value recording whether it was possible or not. (Note that the actual data conversion functions, such as Oct()
throw exceptions if conversion is not possible. The validation functions allow one to test whether a conversion would fail, and change the program's flow of control in an if statement.) True
indicates that conversion would be possible, False
indicates that it would not be. Similarly the type checking functions return a Boolean
recording whether the argument expression is of a particular type.
In Transact-SQL, the functions return zero or one rather than Boolean
values True
and False
.
IsArray(name)
False
from this function in Visual Basic .NET. [7] In Visual Basic 6, arrays are not reference types, and an uninitialized array will return True
from this function just like an initialized array. [8] IsDate(expression)
Date
, or is already of type Date
. Uninitialized variables that are of type Date
can of course be converted, despite being uninitialized, so this will always return True
for such variables. [9] Note that strings that contain a day of the week in addition to a date (e.g. "Sat, October 12, 2010"
) will return a failure result. [10] In VBScript and Visual Basic .NET, the conversion process employs the locale settings of Microsoft Windows, meaning that what may parse as a date on one system, configured to use one locale, may fail to parse as a date on another system, configured to use a different locale. [11] [12] IsDBNull(expression)
System.DBNull.Value
. [9] This is equivalent to Visual Basic 6's IsNull()
function. [10] Note that it is not possible to directly compare an expression for equality to System.DBNull
, because any expression of the form x = DbNull
will evaluate to DbNull
simply because it contains a null. IsDBNull()
is the only way to test for equality to System.DBNull
. [12] IsEmpty(expression)
Null
. [13] Although the function takes an expression, rather than simply a variable name, any expression that isn't simply a variable name is considered not to be an uninitialized variant. [11] This function was available in Visual Basic 6, but has been superseded in Visual Basic .NET by the IsNothing()
function. [14] In VBScript, if a variant is assigned Nothing
, this function still returns False
. [15] IsError(expression)
System.Exception
class or one of its subclasses. [7] In Visual Basic 6, the function tests whether the expression is a variant with the special vbError
subtype. [16] IsMissing(name)
True
only of the variable is a variant that has not been initialized. This function only exists in Visual Basic 6. In Visual Basic .NET, optional parameters are required to have default initializers, and the function no longer exists. [17] IsNothing(expression)
Nothing
. [9] It is a simple library function (comprising just 4 CIL instructions) which can itself be written in Visual Basic as: [18] [19] PublicSharedFunctionIsNothing(ByValExpressionAsObject)AsBooleanReturn(ExpressionIsNothing)EndFunction
False
for all value (non-reference) expressions, because they will be wrapped up, as part of the function call, into objects, which will by their very natures, not be null objects. [18] [19] To avoid this behaviour, one can use the IS
operator to compare an object directly to Nothing
, writing expression
IS Nothing
rather than IsNothing(expression)
. The compiler will raise a compile-time error if the compared expression is a value rather than a reference type, catching the type mismatch at compile time rather than simply returning False
at run-time. [20] Strings are reference types in Visual Basic .NET, and so capable of being null (as opposed to simply zero-length, empty, strings). For such strings, this function returns True
. (For empty strings it returns False
.) [21] [18] IsNull(expression)
Null
. A null value in any sub-expression of the expression causes the entire expression to be considered null. [15] IsNull(expression1,expression2)
Boolean
, but instead returns the first expression if that is not NULL
, otherwise the second expression. [22] The purpose of the function is to replace any NULL
values with another, presumably (but not required to be) non-NULL
, value. [23] It is a two-argument version of COALESCE()
.IsNumeric(expression)
Short
, Integer
, Long
, Single
, Double
, or Decimal
) from a character or string, or is already a number. [24] [25] In Transact-SQL, strings can be converted to numbers even if they contain characters that one might not expect in numbers. This is because Transact-SQL allows conversion from money
and smallmoney
types to numbers, and monetary data in string form may contain currency indicator characters such as the '£
' or '$
' symbols. [26] The same is true of VBScript, where any string that can be converted to a currency value in the current locale is considered to be numeric. VBScript does not, however, consider dates and times to be numeric. [27] IsObject(expression)
IsReference()
function. [10] IsReference(expression)
IsObject()
function. [10] VBScript is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers without error handling and with subroutines and other advanced programming constructs. It can give the user complete control over many aspects of their computing environment.
Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 Feb 2023 stating that VB is a stable language now and Microsoft will keep maintaining it.
In computer programming, a parameter or a formal argument is a special kind of variable used in a subroutine to refer to one of the pieces of data provided as input to the subroutine. These pieces of data are the values of the arguments with which the subroutine is going to be called/invoked. An ordered list of parameters is usually included in the definition of a subroutine, so that, each time the subroutine is called, its arguments for that call are evaluated, and the resulting values can be assigned to the corresponding parameters.
In computer programming, the ternary conditional operator is a ternary operator that is part of the syntax for basic conditional expressions in several programming languages. It is commonly referred to as the conditional operator, ternary if, or inline if. An expression a ? b : c
evaluates to b
if the value of a
is true, and otherwise to c
. One can read it aloud as "if a then b otherwise c". The form a ? b : c
is by far and large the most common, but alternative syntaxes do exist; for example, Raku uses the syntax a ?? b !! c
to avoid confusion with the infix operators ?
and !
, whereas in Visual Basic .NET, it instead takes the form If(a, b, c)
.
This article compares two programming languages: C# with Java. While the focus of this article is mainly the languages and their features, such a comparison will necessarily also consider some features of platforms and libraries. For a more detailed comparison of the platforms, see Comparison of the Java and .NET platforms.
In computer science, the Boolean is a data type that has one of two possible values which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type—logic does not always need to be Boolean.
A user-defined function (UDF) is a function provided by the user of a program or environment, in a context where the usual assumption is that functions are built into the program or environment. UDFs are usually written for the requirement of its creator.
C++/CLI is a variant of the C++ programming language, modified for Common Language Infrastructure. It has been part of Visual Studio 2005 and later, and provides interoperability with other .NET languages such as C#. Microsoft created C++/CLI to supersede Managed Extensions for C++. In December 2005, Ecma International published C++/CLI specifications as the ECMA-372 standard.
C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.
In computing, IIf is a function in several editions of the Visual Basic programming language and ColdFusion Markup Language (CFML), and on spreadsheets that returns the second or third parameter based on the evaluation of the first parameter. It is an example of a conditional expression, which is similar to a conditional statement.
C# and Visual Basic .NET are the two primary languages used to program on the .NET Framework.
Nullable types are a feature of some programming languages which allow a value to be set to the special value NULL instead of the usual possible values of the data type. In statically typed languages, a nullable type is an option type, while in dynamically typed languages, equivalent behavior is provided by having a single null value.
The original Visual Basic is a third-generation event-driven programming language from Microsoft known for its Component Object Model (COM) programming model first released in 1991 and declared legacy during 2008. Microsoft intended Visual Basic to be relatively easy to learn and use. Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects.
Variant is a data type in certain programming languages, particularly Visual Basic, OCaml, Delphi and C++ when using the Component Object Model. It is an implementation of the eponymous concept in computer science.
Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET. It was originally shipped as an integral part of .NET Framework, however starting with Entity Framework version 6.0 it has been delivered separately from the .NET Framework.
The null coalescing operator is a binary operator that is part of the syntax for a basic conditional expression in several programming languages, including C#, PowerShell as of version 7.0.0, Perl as of version 5.10, Swift, and PHP 7.0.0. While its behavior differs between implementations, the null coalescing operator generally returns the result of its left-most operand if it exists and is not null, and otherwise returns the right-most operand. This behavior allows a default value to be defined for cases where a more specific value is not available.
This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.
Language Integrated Query is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages, originally released as a major part of .NET Framework 3.5 in 2007.
XLeratorDB is a suite of database function libraries that enable Microsoft SQL Server to perform a wide range of additional (non-native) business intelligence and ad hoc analytics. The libraries, which are embedded and run centrally on the database, include more than 450 individual functions similar to those found in Microsoft Excel spreadsheets. The individual functions are grouped and sold as six separate libraries based on usage: finance, statistics, math, engineering, unit conversions and strings. WestClinTech, the company that developed XLeratorDB, claims it is "the first commercial function package add-in for Microsoft SQL Server."
The syntax of the SQL programming language is defined and maintained by ISO/IEC SC 32 as part of ISO/IEC 9075. This standard is not freely available. Despite the existence of the standard, SQL code is not completely portable among different database systems without adjustments.
IsArray
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsDate
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsDBNull
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsError
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsNothing
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsNumeric
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.IsReference
method". MSDN: .NET Framework Class Library: Microsoft.VisualBasic
namespace. Microsoft.