0% found this document useful (0 votes)
162 views

Basics Reference Sheet

This document provides a summary of basic Visual Basic syntax including: - Variable and data type declarations - Array manipulation - Arithmetic, relational, and logical operators - Conditional statements such as If/Else and Select Case - Looping structures like For, For Each, and While - Functions, classes, and error handling The document is intended as a quick reference for Visual Basic syntax.

Uploaded by

theyseeme5465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Basics Reference Sheet

This document provides a summary of basic Visual Basic syntax including: - Variable and data type declarations - Array manipulation - Arithmetic, relational, and logical operators - Conditional statements such as If/Else and Select Case - Looping structures like For, For Each, and While - Functions, classes, and error handling The document is intended as a quick reference for Visual Basic syntax.

Uploaded by

theyseeme5465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

010010100101011010101101001010101001011101011010

Namespace Imports Namespace Data Types Boolean,Byte,Char,DateTime,Decimal,Double,Int16,Int32,Int64,Integer, Long, Object, Short,Single,String,IntPtr,UInteger,UintPtr Variable Declaration Dim | Public | Private <variable_name> As <type> Type Declaration Dim | Public <variable><suffix> Suffixes % -Integer. $ - String, @ - Decimal, & - Long, # - Double, ! - Single Arrays Dim <arrayname>(<MaxIndexVal>) As <type> Dim <arrayname>(<LowerBound> To <UpperBound>) As <type> Initialize Array Dim <arrayname>() As <type> = {<value1>, <value2>, ... , <valueN>} Change Size of Array ReDim <arrayname>(<MaxIndexVal>) Comments 'Comment text 'No multi-line comments at this time XML Comments Press the ' (apostrophe) key thrice. Line Continuation strtext = To break a long string across multiple lines, & _ end the string, add the line continuation character & _ and continue the string on the next line. Arithmetic Operators + (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulus) String Concatenation +, & Relational Operators < (Less Than), <= (Less Than or Equal To),> (Greater Than),>= (Greater Than or Equal To),= (Equal To),<> (Not Equal To) Logical Operators OR, NOT, AND, AndAlso, OrElse, Xor String Manipulation .Substring(<start>,[<length>]) .Trim() <trims from beginning & end of string> .TrimEnd([<char array>]) .TrimStart([char array]) .ToLower() <to lower case> .ToUpper() <to upper case> .Replace(<find>,<replace>) .Equals(<expression>) <6 available overloads> .Contains(<string>) .Join(<seperator>,<value>,[<count>]) .Compare(<string1>,<string2>,[<ignore case>]) <7 overloads available> .Copy(<string>)

If Else If(<expression>) Then <statement 1> Else <statement 2> End If Inline If variable = IIf( condition, value_if_false, value_if_true ) For Loop For <initialize> (Relational Operator) <condition> <statement> Next For Each Loop For Each <variable> In <object> [Exit For] <statements> [Continue For] <statements> Next While Loop While <expression> <statement> End While Do-While Loop Do <statement> Loop While <expression> Select Case Statement Select Case <expression> Case <expression1>: <statement sequence 1> Case <expression2> <statement sequence 2> Case <expressionN> <statement sequence N-1> Case Else <statement sequence N> End Select Function Structure <Private, Public> <Function_Name>([Parameters]) body of the function End Function Class Structure Public Class <Class_Name> body of class End Class Public 'method_prototypes 'data_attributes Private 'method_prototypes 'data_attributes Friend 'method_prototypes Shared 'method_prototypes 'data_attributes Error Handling Try <statements that may cause an error> Catch <statements to use when an error occurs> Finally <statements to use no matter what happens> End Try

Download More Reference Sheets & Get Programming Help @ http://www.DreamInCode.net


Edited By: born2c0de, Louisda16th, PsychoCoder, TophCoder Published: August 18, 2007

You might also like