CIS 110 Notes on Data Types
Total Page:16
File Type:pdf, Size:1020Kb
CIS 115 – Visual Basic Programming
Visual Basic.Net Data Types: Data Type Description Memory 3 Character Used Prefix Boolean True or False Value 2 bytes bln Byte Single ASCII character (0-255) 1 byte byt Char Unicode Character (1 – 65535) 2 bytes chr Date 8 character date: #dd/mm/yyyy# 8 bytes dtm (must be enclosed within number signs) Decimal Decimal value, up to 28 places to 16 bytes dec rights of decimal point Double Double-precision floating point 8 bytes dbl numbers to 14 digits of accuracy Integer Whole numbers approx. +/- 4 bytes int 2,147,483,648 Long Whole numbers approx. +/- 8 bytes lng 9,223,372,036,854,775,808 Object A variable of type object can hold 4 bytes obj (DEFAULT) values of any data type Short Whole numbers approx. +/- 32,767 2 bytes shr Single Single precision floating point 4 bytes sng numbers, 6 digits of accuracy String Alphanumeric data (See ASCII Chart) 0-2 billion str characters User-Defined Determined by programmer
Arithmetic Operators: ^ Exponential MOD Modulus * Multiplication + Addition / Floating Point Division - Subtraction \ Integer Division & String Concatenation (Preferred Method)
Relational Operators (Comparison Operators) Logical Operators = Equals and Assignment Indicator NOT <> Not Equal AND <= Less Than or Equal To OR >= Greater Than or Equal To XOR
Mathematical Order of Precedence (Operator Precedence) Mathematical (Parenthesis, Exponential, Multiplication/Division, Integer Division, Integer Remainder (MOD), Addition/Subtraction, String Concatenation) Relational Logical (NOT then AND then OR/XOR)
Assignment Statements VariableName = Expression