User`s guide
Using .NET with VEE 7
VEE User’s Guide 293
Programming Practices
Converting Data Types Between .NET and VEE
VEE converts data types between VEE and .NET
automatically for all data types that both VEE and .NET
natively support. For example, Int16, Int32, Real64, etc. You
may wish to “undo” this automatic conversion so you can
use the data as a true .NET object. In those cases, you can
use the new asClrType() type conversion function to convert
a VEE data type to a .NET/CLR type. See the conversion
tables below for more details.
.NET operations in VEE will usually accept a
precision- widening (type promotion) data type as a
parameter, but not a precision- narrowing (type demotion)
data type. For example, you may pass VEE’s UInt8 to a .NET
operation that requires a parameter of type System.Int16,
but not the other way around. Also, if the .NET operation
requires a ByRef parameter and you want to retrieve its
result back, then the data type has to match exactly. For
example, if the .NET method requires a parameter of type
ByRef Int32, then you can only pass VEE’s ByRef Int32 data
type. If you don’t care about retrieving the result back, then
you may skip the ByRef keyword and the normal parameter
rule would apply.
The following tables illustrate the data type conversion
functions between VEE and .NET.
Table 3 1 Converting .NET scalar data types to VEE data types in VEE 7.0
Convert From .NET Data Ty pe Con vert To VEE
Data Type
Notes
System.Boolean Int16 Use isVariantBool() to determine if the VEE Int16 was
of type System.Boolean
System.Byte Uint8