|
Hot-Link Menu in Right-Side Column |
Last Updated 6-30-2010 |
||||||||||||||||||||||||||||||
|
How to work with Scope in Visual BasicPrograms written contain Variables, Constants and Arrays. In modern programming languages variables are only valid in a limited section of the program, and invalid or even non-existent in other parts. The part of the program that a variable is valid and can be used by the programmer is referred to as: Scope. In order to help understand the concept of Scope a short synopsis for working with scope is given in the diagram below:
How to declare and use enumeration in Visual BasicOften, when writing code, it is necessary to select an option, from a related group of options. For example, Customer payment terms could be Net 30 Days, Net 60 Days and Net 90 Days for different customers. If you assign a constant value such as '0' for 30 Days, '1' for 60 Days and '2' for Net 90 Days. In this case using Enumerations could simplify the programming process, and make your code more readable. For some examples on enumeration and the associated syntax, refer to the diagram below:
How to Declare and use Nullable Types in Visual BasicOccasionally, in programming it is necessary to know if a variable has had a value assigned to it yet, as in the case of whether or not a user has supplied requested information. The Null value refers to the concept of Nothing Yet as opposed to 0, the amount left in my wallet after my wife has gone shopping. The syntax and examples of Nullable Types are given in the diagram below:
|
Home Visual Basic Introduction to VB.NET.NET Framework VS2008 IDE How VB is Compiled Start Visual Studio Windows Form App Save Your Work VB OOP ProgrammingVisual Basic Code Exit Code Button Event Code Coding RecommendationsIf/Then/Else Error List Window Comment Syntax Help Window Language Essentianl Built-In Data Types Declare Variables Declare ConstantsCode Arithmetic Expressions Assignment Statements Operator Precedence Type Casting Math Class String DeclarationConversion Functions Conversion Methods Formatting Functions String Formatting Variable Scope EnumerationsNullable Types Loop Constructs For Next LoopDo While Loop Do Until Loop Do...Loop-WhileDo...Loop-Until Exit Do | Exit For Do...LoopNested Loops Arrays Array DeclarationRnd( ) Function Listbox ControlKeyPressEventArgs Parallel Arrays Key Event ArgsDynamic Arrays Redimension ArraySet Breakpoint Start Debugger ReDim Preserve MultiDimensional Arrays DataGridView ControlLength and Sort Methods Structures Pad RightSplit Method IsNumeric Function Multiform Projects Add Form To Project Form Object Methods Form Show Method ShowDialog Method Form Close Method Form Accept Button Multiform Project Example ASP.NET Web Programming Create Data SourceConfigure Access Data Source Add Product Class Extract Local Database Data Order PageLoad VB CodeAdd New Web Page Set Start Page Display Cart Aspx CodeDisplay Cart Design View Sorted List Definition VB.NET Session State Create CartItem Class GetCartContents FunctionAdd To Cart Event Handler Remove Cart Item EventClear Cart Event Handler |
|||||||||||||||||||||||||||||