VBNET
VBNET
NET It is an object-oriented
Visual Basic .NET (VB.NET) is an object- programming language. It treats
oriented computer programming language everything as an object.
implemented on the .NET Framework. Automatic code formatting, XML
designer, improved object browser
etc.
Although it is an evolution of classic Visual Garbage collection is automated.
Basic language, it is not backwards- Support for Boolean conditions for
compatible with VB6, and any code written decision making.
in the old version does not compile under Simple multithreading, allowing
VB.NET your apps to deal with multiple tasks
simultaneously.
Simple generics
Everything in VB.NET is an object, including
A standard library
all of the primitive types (Short, Integer,
Long, String, Boolean, etc.) and user defined Events management
types, events, and even assemblies. All References. You should reference an
objects inherit from the base class Object. external object that is to be used in
a VB.NET application.
Attributes, which are tags for
VB.NET is implemented by Microsoft's .NET providing additional information
framework. Therefore, it has full access to regarding elements that have been
all the libraries in the .Net Framework. It's defined within a program.
also possible to run VB.NET programs on Windows Forms - you can inherit
Mono, the open-source alternative to .NET, your form from an already existing
not only under Windows, but even Linux or form.
Mac OSX.
Strengths of VB.Net
VB.Net programming is very much based on
Your code will be formatted
BASIC and Visual Basic programming
automatically.
languages, so if you have basic
You will use object-oriented
understanding on these programming
constructs to create an enterprise
languages, then it will be a fun for you to
class code.
learn VB.Net programming language.
You can create web applications
with modern features like
VB. Net Features performance counters, event logs,
and file system.
VB.NET is not case sensitive like
You can create your web forms with
other languages such as C++ and
much ease through the visual forms
Java.
designer. You will also enjoy drag
and drop capability to replace any VB. NET Anatomy
elements that you may need. Imports System
You can connect your applications to
other applications created in It is used to include the System
languages that run on the .NET namespace in the program.
framework.
You will enjoy features like docking, Module
automatic control anchoring, and declaration of module Module1.
in-place menu editor all good for Every program requires a class
developing web applications. module for data and procedures.
Tutorialspoint
OneCompiler
JDoodle
GDB Online Debugger
Data Types Variable Naming Rules
Data Type Storage Allocation You must use a letter as the first
Boolean It depends on character.
implementing You can't use a space, period (.),
platform exclamation mark (!), or the
Byte 1 byte characters @, &, $, # in the name.
Char 2 bytes Name can't exceed 255 characters in
Date 8 bytes length.
Decimal 16 bytes
Generally, you shouldn't use any
Double 8 bytes
names that are the same as the
Integer 4 bytes
function, statement, method, and
Long 8 bytes
intrinsic constant names used in
Object 4 bytes (32 bit)
8 bytes (64 bit) Visual Basic or by the host
SByte 1 byte application
Short 2 bytes You can't repeat names within the
Single 4 bytes same level of scope.
String It depends on
implementing
platform Console.ReadLine()
UShort 2 bytes It will read the console input from
UInteger 4 bytes the user, up until the next newline is
ULong 8 bytes detected (usually upon pressing the
User-defined It depends on Enter or Return key).
implementing Code execution is paused in the
platform current thread until a newline is
provided. Afterwards, the next line
Variables of code will be executed.
A name given to a storage area that
our programs can manipulate. Constants
Refer to fixed values that the
Each variable in VB.Net has specific program may not alter during its
type, which determine the size and execution.
layout of the variable's memory. Can be of any of the basic data type.
Treated just like regular variables
The Dim statement is used for except that their values cannot be
variable declaration and storage modified after their definition
allocation for one or more variables. An enumeration is a set of named
integer constants. (Enum nameVar)
Dim myVariable As DataType Const myVariablel As DataType
declaration context, including from
Modifiers within any contained types.
Protected
Array
Specifies that one or more declared
programming elements are It is used to store a collection of
accessible only from within their data, but it is often more useful to
own class or from a derived class. think of an array as a collection of
variables of the same type.
All arrays consist of contiguous
Default
memory locations. The lowest
Identifies a property as the default address corresponds to the first
property of its class, structure, or element and the highest address to
interface. the last element.
Private
User Defined Functions
Specifies that one or more declared
Functions are group of statements that
programming elements are
together perform a task when called. After
accessible only from within their
the procedure is executed, the control
returns to the statement calling the Round()
procedure. Rounds a number to the nearest
integer.
Built In Functions
LCase() Floor()
Returns a string or character the largest integer that's less than or
converted to lowercase. equal to the specified Decimal or
Double number.
UCase()
Returns a string or character
containing the specified string
converted to uppercase.
Trim()
Returns a string containing a copy of
a specified string with no leading or
trailing spaces.
Len()
Returns an integer that contains the
number of characters in a string.
FormatPercent()
Returns an expression formatted as
a percentage (that is, multiplied by
100) with a trailing % character.
Abs()
Returns the absolute value of a
number.
Sqrt()
Returns the square root of a
number.