Documentation (c) 2006-2008 Hobby-Robotics, LLC
Data type is a fundamental element of any programming language. Currently HBBR Basic supports following simple types as well strings and as arrays of simple types.
List of supported simple types:
Boolean
SByte
Byte
Short
UShort
Integer
UInteger
Single
Boolean type represents logical values True and False. It is used to perform logical operations (not bitwise!).
Example:
Dim boolVar As Boolean
Const boolConst As Boolean = True
Dim boolArray(1 To 2 ) As Boolean
Sub boolSub( ByVal boolArg As Boolean)
SByte type can be use to represent signed 8 bit value from -128 to 127
Example:
Dim sbyteVar As SByte
Const sbyteConst As SByte = &b11111111
Dim sbyteArray(1 To 2 ) As SByte
Sub sbyteSub( ByVal sbyteArg As SByte)
Byte type can be use to represent unsigned 8 bit value from 0 to 255.
Example:
Dim byteVar As Byte
Const byteConst As Byte = &b11111111
Dim byteArray(1 To 2 ) As Byte
Sub byteSub( ByVal byteArg As Byte)
http://en.wikipedia.org/wiki/Byte
Short type represents singed 16 bit value from to -32768 to 32767.
Example:
Dim shortVar As Short
Const shortConst As Short = &hFFFF
Dim shortArray(1 To 2 ) As Short
Sub shortSub( ByVal shortArg As Short)
UShort type represents unsigned 16 bit value from 0 to 65535.
Example:
Dim ushortVar As UShort
Const ushortConst As UShort = &hFFFF
Dim ushortArray(1 To 2 ) As UShort
Sub ushortSub( ByVal ushortArg As UShort)
Integer type represents singed 32 bit value from to -2147483648 to 2147483647.
Example:
Dim integerVar As Integer
Const integerConst As Integer = &hFFFFFFFF
Dim integerArray(1 To 2 ) As Integer
Sub integerSub( ByVal integerArg As Integer)
UInteger type represents usinged 32 bit value from 0 to 4294967295.
Example:
Dim uintegerVar As UInteger
Const uintegerConst As UInteger = &hFFFFFFFF
Dim uintegerArray(1 To 2 ) As UInteger
Sub uintegerSub( ByVal uintegerArg As UInteger)
Single type represents floating point values from -3.402823E38 to 3.402823E38 .
Example:
Dim singleVar As Single
Const singleConst As Single = 1.0
Dim singleArray(1 To 2 ) As Single
Sub singleSub( ByVal singleArg As Single)
Floating operation require runtime MOD file with built-in math support. If code is compiled with the runtime without math support linker will report errors while trying to locate runtime floating point support functions.