Export (0) Print
Expand All

Data Types

Microsoft Robotics

Glossary Item Box

VPL Reference: VPL MenusUtilities Overview

Microsoft Robotics Developer StudioSend feedback on this topic

Data Types

The Microsoft Visual Programming Language supports .NET C# style data types.

VPL TypeDescription
boolBoolean values: true, false
byte8 bit unsigned integer (0 to 255)
sbyte8 bit signed integer (-128 to 127)
charcharacter
decimalfixed point decimal number (fixed precision number)
doubledouble precision (64-bit) floating point number (approx 14 significant digits)
floatsingle precision (32-bit) floating point number (approx 7 significant digits)
int32 bit signed integer
uint32 bit unsigned integer
long64 bit signed integer
ulong64 bit unsigned integer
short16 bit signed integer (-32768 to 32767)
ushort16 bit unsigned integer (0 to 65535)
stringcharacter string (text)

VPL supports Lists but not Arrays. However, a List can often be used instead of an Array. (An array is a set of variables that are all of the same data type and are accessed via a single variable name and an index. They are usually of fixed length. Lists are more general-purpose and allow you to insert and delete elements anywhere in the list.)

VPL has limited support for arbitrary user-defined data types. The simple data structures used in operation messages can generally be used in expressions using "dot notation" to select the members of a class. VPL usually creates a variable called value to hold the response from an activity. If this value is a compound data type (referred to as a class or a structure) then you can access its elements (called members or properties). In the the following example a string property called FullName can be obtained from a message:

value.FullName

To convert from one data type to another, you can use C# cast operations. For example, to convert from an integer called myInt to a string, use this expression:
(string) myInt

Sometimes casts fail because the data cannot be represented using the new data type. For example, if the string called FullName contains "abc" and is cast to an integer using

(int) FullName

it will not work because the string does not contain the text equivalent of a number. However, if it contained "123" the cast would succeed.

VPL Reference: VPL MenusUtilities Overview

 

 

© 2012 Microsoft Corporation. All Rights Reserved.

Show:
© 2014 Microsoft