|Top Previous Next|
NativeVB is natively implemented Basic like language. It is untyped, Variant-based, dynamic scripting language. NativeVB supports declaration of procedures (Subs) and functions, variables declaration, global statements. It also supports Delphi like true exception handling features using throw/try/catch/finally syntax.
The language introduce a variety set of statements to control execution of the script-code. For conditional code execution the program can use conditional statements, for looping/iterating - loop statements, for exception raising and handling - exception handling statements.
Along with the classic VB syntax like Dim, Call, Set, NativeVB provides modern VB .Net like syntax, such as Return, New, TypeOf/Is.
NativeVB is untyped Variant-based language. This means that every variable or parameter in the language is of Variant type. NativeVB supports all Variant value types, supported by Delphi, including numbers, strings, Booleans, dates, IDispatch objects, as well as special values Null, Empty, Nothing, True and False. Arrays are also supported.
Just like in classic Basic, line-breaks are important in NativeVB language. Thus, it is invalid to write several statements separated by white-space in a single line. Nevertheless, NativeVB language (just like MS VBScript) provides special syntax to allow writing several short statements in a single line; colon ":" symbol can be used instead of line-breaks, for example:
Dim x(2) : x(0) = 1 : x(1) = 2
In addition to ordinal identifiers, NativeVB language allows writing identifiers in square brakets; this form of identifiers can contain not only letters and digits, but also spaces and other symbols; for example:
Dim [My super var++] = 7
If [My super var++] > 10 Then
In the above example [My super var++] is a valid NativeVB identifier. This style of identifiers can be used while working with imported object models with object or method names, which are not valid identifiers at all or match one of the NativeVB keyword.