Tumgik
Syntax
VB.NET uses statements to specify actions. The most common statement is an expression statement, consisting of an expression to be evaluated, on a single line. As part of that evaluation, functions or subroutines may be called and variables may be assigned new values. To modify the normal sequential execution of statements, VB.NET provides several control-flow statements identified by reserved keywords. Structured programming is supported by several constructs including two conditional execution constructs (If … Then … Else … End If and Select Case ... Case ... End Select ) and three iterative execution (loop) constructs (Do … Loop, For … To, and For Each) . The For … To statement has separate initialisation and testing sections, both of which must be present. (See examples below.) The For Each statement steps through each value in a list.
In addition, in Visual Basic .NET:
There is no unified way of defining blocks of statements. Instead, certain keywords, such as "If … Then" or "Sub" are interpreted as starters of sub-blocks of code and have matching termination keywords such as "End If" or "End Sub".
Statements are terminated either with a colon (":") or with the end of line. Multiple line statements in Visual Basic .NET are enabled with " _" at the end of each such line. The need for the underscore continuation character was largely removed in version 10 and later versions.[2]
The equals sign ("=") is used in both assigning values to variable and in comparison.
Round brackets (parentheses) are used with arrays, both to declare them and to get a value at a given index in one of them. Visual Basic .NET uses round brackets to define the parameters of subroutines or functions.
A single quotation mark ('), placed at the beginning of a line or after any number of space or tab characters at the beginning of a line, or after other code on a line, indicates that the (remainder of the) line is a comment.
Simple example
The following is a very simple VB.NET program, a version of the classic "Hello world" example created as a console application:
Module Module1    Sub Main()        ' The classic "Hello World" demonstration program        Console.WriteLine("Hello World!")    End Sub End Module
It prints "Hello world!" on a command-line window. Each line serves a specific purpose, as follows:
Module Module1
This is a module definition, a division of code similar to a class, although modules can contain classes. Modules serve as containers of code that can be referenced from other parts of a program.[3] It is common practice for a module and the code file, which contains it, to have the same name; however, this is not required, as a single code file may contain more than one module and/or class definition.
Sub Main()
It defines a subroutine called "Main". "Main" is the entry point, where the program begins execution.[4]
Console.WriteLine("Hello world!")
This line performs the actual task of writing the output. Console is a system object, representing a command-line interface (also known as "console") and granting programmatic access to the operating system's standard streams. The program calls the Console method WriteLine, which causes the string passed to it to be displayed on the console.
Instead of Console.WriteLine, one could use MsgBox, which prints the message in a dialog box instead of a command-line window.
1 note · View note
Version history
Tumblr media
Version history
Succeeding the classic Visual Basic version 6.0, the first version of Visual Basic .NET debuted in 2002. As of 2014, seven versions of Visual Basic .NET are released.
2002 (VB 7.0)[
edit
]
The first version, Visual Basic .NET, relies on .NET Framework 1.0. The most important feature is managed code, which contrasts with the classic Visual Basic.
2003 (VB 7.1)[
edit
]
Visual Basic .NET 2003 was released with .NET Framework 1.1. New features included support for the .NET Compact Framework and a better VB upgrade wizard. Improvements were also made to the performance and reliability of .NET IDE (particularly the background compiler) and runtime. In addition, Visual Basic .NET 2003 was available in the Visual Studio.NET Academic Edition, distributed to a certain number of scholars[weasel words] from each country without cost.
2005 (VB 8.0)[
edit
]
After Visual Basic .NET 2003, Microsoft dropped ".NET" from the name of the product, calling the next version Visual Basic 2005.
For this release, Microsoft added many features intended to reinforce Visual Basic .NET's focus as a rapid application development platform and further differentiate it from C#., including:
Edit and Continue feature[further explanation needed]
Design-time expression evaluation[further explanation needed]
A pseudo-namespace called "My", which provides:[10][11]
Easy access to certain areas of the .NET Framework that otherwise require significant code to access like using
My.Form2.Text = " MainForm "
rather than
System.WindowsApplication1.Forms.Form2.text = " MainForm "
Improved VB-to-VB.NET converter[12]
A "using" keyword, simplifying the use of objects that require the Dispose pattern to free resources
Just My Code feature, which hides (steps over) boilerplate code written by the Visual Studio .NET IDE and system library code during debugging
Data Source binding, easing database client/server development
Dynamically generated classes (e.g. My.Forms)
To bridge the gaps between itself and other .NET languages, this version added:
Generics[13]
Partial classes, a method of defining some parts of a class in one file and then adding more definitions later; particularly useful for integrating user code with auto-generated code
Operator overloading and nullable types[14]
Support for unsigned integer data types commonly used in other languages
Visual Basic 2005 introduced the IsNot operator that makes 'If X IsNot Y' equivalent to 'If Not X Is Y'. It gained notoriety[15] when it was found to be the subject of a Microsoft patent application.[16][17]
2008 (VB 9.0)[
edit
]
Visual Basic 9.0 was released along with .NET Framework 3.5 on 19 November 2007.
For this release, Microsoft added many features, including:
A true conditional operator, "If(condition as boolean, truepart, falsepart)", to replace the "IIf" function.
Anonymous types
Support for LINQ
Lambda expressions
XML Literals
Type Inference
Extension methods
2010 (VB 10.0)[
edit
]
In April 2010, Microsoft released Visual Basic 2010. Microsoft had planned to use Dynamic Language Runtime (DLR) for that release[18] but shifted to a co-evolution strategy between Visual Basic and sister language C# to bring both languages into closer parity with one another. Visual Basic's innate ability to interact dynamically with CLR and COM objects has been enhanced to work with dynamic languages built on the DLR such as IronPython and IronRuby.[19] The Visual Basic compiler was improved to infer line continuation in a set of common contexts, in many cases removing the need for the "_" line continuation character. Also, existing support of inline Functions was complemented with support for inline Subs as well as multi-line versions of both Sub and Function lambdas.[20]
2012 (VB 11.0)[
edit
]
Visual Basic 2012 was released along .NET Framework 4.5. Major features introduced in this version include:[further explanation needed]
Asynchronous programming with "async" and "await" statements
Iterators
Call hierarchy
Caller information
"Global" keyword in "namespace" statements
2015 (VB 14.0)[
edit
]
Visual Basic 2015 (code named VB "14.0") has been released with Visual Studio 2015.
Language features include a new "?." operator to perform inline null checks, and a new string interpolation feature is included to format strings inline.[
0 notes
VISUAL BASIC
Tumblr media
Visual Basic is a third-generation event-driven programming language and integrated development environment (IDE) fromMicrosoft for its Component Object Model (COM) programming model first released in 1991 and declared legacy in 2008. Microsoft intended Visual Basic to be relatively easy to learn and use.[1][2] Visual Basic was derived from BASIC, a user-friendly programming language designed for beginners, and it enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects.
A programmer can create an application using the components provided by the Visual Basic program itself. Over time the community of programmers developed third party components.[3][4][5][6][7] Programs written in Visual Basic can also use theWindows API, which requires external function declarations.
The final release was version 6 in 1998 (now known simply as Visual Basic). On April 8, 2008 Microsoft stopped supporting Visual Basic 6.0 IDE. The Microsoft Visual Basic team still maintains compatibility for Visual Basic 6.0 applications on Windows Vista, Windows Server 2008 including R2, Windows 7, Windows 8, Windows 8.1, Windows Server 2012 and Windows 10through its "It Just Works" program.[8] In 2014, some software developers still preferred Visual Basic 6.0 over its successor,Visual Basic .NET.[3][9] In 2014 some developers lobbied for a new version of Visual Basic 6.0.[10][11][12][13] In 2016, Visual Basic 6.0 won the technical impact award at The 19th Annual D.I.C.E. Awards.[14][15][16] A dialect of Visual Basic, Visual Basic for Applications (VBA), is used as a macro or scripting language within several Microsoft applications, including Microsoft Office.[17]
Contents
1Language features
2Characteristics
3History
4Derivative languages
5Performance and other issues
6Legacy development and support
7Example code
8See also
9References
10External links
3.1Timeline
3.1.11990s
3.1.22000s
Language features[edit]
Like the BASIC programming language, Visual Basic was designed to accommodate a steep learning curve. Programmers can create both simple and complex GUI applications. Programming in VB is a combination of visually arranging components or controls on a form, specifying attributes and actions for those components, and writing additional lines ofcode for more functionality. Since VB defines default attributes and actions for the components, a programmer can develop a simple program without writing much code. Programs built with earlier versions suffered performance problems, but faster computers and native code compilation has made this less of an issue.[citation needed] Though VB programs can be compiled into native code executables from version 5 on, they still require the presence of around 1 MB of runtime libraries. Core runtime libraries are included by default in Windows 2000 and later, but extended runtime components still have to be installed. Earlier versions of Windows (95/98/NT), require that the runtime libraries be distributed with the executable.
An empty form in Visual Basic 6.
Tumblr media
Forms are created using drag-and-drop techniques. A tool is used to place controls (e.g., text boxes, buttons, etc.) on the form (window). Controls have attributes and event handlers associated with them. Default values are provided when the control is created, but may be changed by the programmer. Many attribute values can be modified during run time based on user actions or changes in the environment, providing a dynamic application. For example, code can be inserted into the form resize event handler to reposition a control so that it remains centered on the form, expands to fill up the form, etc. By inserting code into the event handler for a keypress in a text box, the program can automatically translate the case of the text being entered, or even prevent certain characters from being inserted.
Visual Basic can create executables (EXE files), ActiveX controls, or DLL files, but is primarily used to develop Windows applications and to interface database systems. Dialog boxes with less functionality can be used to provide pop-up capabilities. Controls provide the basic functionality of the application, while programmers can insert additional logic within the appropriate event handlers. For example, a drop-down combination box automatically displays a list. When the user selects an element, an event handler is called that executes code that the programmer created to perform the action for that list item. Alternatively, a Visual Basic component can have no user interface, and instead provide ActiveX objects to other programs via Component Object Model (COM). This allows for server-side processing or an add-in module.
The runtime recovers unused memory using reference counting, which depends on variables passing out of scope or being set to Nothing, avoiding the problem of memory leakscommon to other languages. There is a large library of utility objects, and the language provides basic object oriented support. Unlike many other programming languages, Visual Basic is generally not case sensitive—though it transforms keywords into a standard case configuration and forces the case of variable names to conform to the case of the entry in the symbol table. String comparisons are case sensitive by default. The Visual Basic compiler is shared with other Visual Studio languages (C, C++). Nevertheless, by default the restrictions in the IDE do not allow creation of some targets (Windows model DLLs) and threading models, but over the years, developers have bypassed these restrictions.
0 notes
Computer Monitor Trends
Tumblr media
Philips' Brilliance BDM3490UC should be your top pick if you're looking to watch movies or work from home. Its IPS display is bright and inviting, effectively replicating the experience of going to the cinema (just make sure you bring the popcorn and close the curtains). The 21:9 curved display can be a bit disorienting, sure, if you're accustomed to standard flat screen displays. Still, this one takes the cake for gaming. Notably absent, though, are both G-Sync and FreeSync, so don't forget to tick the vertical sync box in all your games. Plus, as long as you're set on a 21:9 cinematic panel, the Brilliance is competitively priced as well.
Tumblr media
If you care more about frame rate than graphics or resolution, this one's for you. Because of its mind-blowing 180Hz refresh rate capabilities, the Asus ROG Swift PG248Q takes the 60 fps gold standard for gaming and triples it – provided you're equipped with a rig that can handle the extra stress.
Tumblr media
Cinematic monitors are a great alternative to their 4K counterparts when it comes to gaming. In fact, you might say they're even better due to their ultrawide 21:9 aspect ratio. The Acer Predator X34 certainly looks the part, featuring an eye-catching aluminium bezel and angular, crow's foot-shape stand. It comes with a number of gaming mod cons in tow, including Nvidia's G-Sync frame-smoothing tech, an immersion-boosting curved shape and fantastic color reproduction that brings games to life. Short of strapping on a virtual reality headset, the Predator X34 is about as immersive as gaming gets.
Tumblr media
If your PC can't afford 1440p or 4K gaming, the Asus MG248Q is the next best thing. Despite exhibiting a mere 1080p twisted-nematic TN panel rather than IPS, the Asus MG248Q makes up for it with lightning fast response times and Adaptive Sync. The latter reduces screen tearing if you have an AMD graphics card, a clear demonstration that the MG248Q tailors to the budget gamer.
On the other hand, even Nvidia fans can rejoice at the 144Hz refresh rate, allowing for more than double that of the 60 fps gold standard in gaming. But, without the right GPU equipped, you might be better off saving for the G-Sync equivalent Asus ROG Swift PG248Q.
Tumblr media
A 4K display that's factory-calibrated for great color accuracy and image quality, the Samsung UD970 is ideal for digital designers, CAD/CAM engineers and videographers who aren't put off by the high-price tag.  
The matte finish only adds to the appeal of the Samsung UD970 by giving it a smudge-reducing, glare-remitting face for the absolute best work environment possible. Samsung also includes Picture By Picture (PBP) support on the UD970, which makes for the ultimate multi-tasking scenario if you have multiple inputs connected to your display.
0 notes