VisualBasic (VB) is an event-driven programming language and environment from Microsoft that provides a graphical user interface (GUI) which allows programmers to modify code by simply dragging and dropping objects and defining their behavior and appearance. VB is derived from the BASIC programming language and is considered to be event-driven and object-oriented.
VB is intended to be easy to learn and fast to write code with; as a result, it is sometimes called a rapid application development (RAD) system and is used to prototype an application that will later be written in a more difficult but efficient language.
The last version of VB, Visual Basic 6, was released in 1998, but has since been replaced by VB .NET, Visual Basic for applications (VBA) and Visual Stuido .NET. VBA and Visual Studio are the two frameworks most commonly used today.
VB is a GUI-based development tool that offers a faster RAD than most other programming languages. VB also features syntax that is more straightforward than other languages, a visual environment that is easy to understand and high database connectivity.
Visual Basic was designed to be a complete programming language that contained ordinary features, such as string processing and computation. The visual environment is characterized by a drag-and-drop feature which allows programmers to build a user interface that is easy to use, even for developers with minimum experience.
While these features of VB are advantageous, there are others that can have a negative effect. The VB programming environment requires a large amount of memory, both for the initial installation and to run efficiently afterwards. The graphical features of the programming tool take up a large amount of space and require a significant amount of memory.
Finally, with C languages, programmers can feasibly locate and use the defined values for variable data in a computer program at declaration time. This initialization practice is something that isn't easily done with VB.
The structure of VB is designed to allow programmers to use the environment to write executable files (exe files). Also, using VB, developers can create programs that can be utilized as a front end to databases. VB tools can help programmers develop applications or complete software while still allowing them to modify and revise their work accordingly.
The most popular type of Visual Basic in use today is VBA. VBA is a version of Visual Basic that can be used to program Microsoft Office apps, such as Excel and PowerPoint. However, it can only be used to modify existing apps; VBA cannot be used to create new apps.
Typical users engage VBA to make repeated, everyday tasks less monotonous through the use of macros. Macros automate almost any activity -- such as performing word and data processing or generating custom charts and tables. For example, a typical user might write a macro that allows them to create and fill a spreadsheet with a single click. Computer professionals use VBA and macros in more complicated ways. Programmers will often write macros that can replicate large portions of code or define specific languages.
Businesses and organizations can use VBA to customize Excel for their unique purposes, such as pulling certain statistics or information from a spreadsheet. Businesses and organizations can also use VBA externally, or in non-Microsoft applications, by applying a technology called a component object model (COM) interface that enables commands to communicate across computer boundaries. This allows VBA to be used on an enterprise-specific application.
However, VB becomes extremely beneficial when used with Microsoft's COM interface. The COM components can be written in various languages and then integrated using VB. Additionally, VB provides not only a programming language, but an integrated development environment (IDE) that has been written and optimized to best support RAD. This allows programmers to easily build GUIs and connect them to functions within the application.
Overall, VB enables the rapid development of Windows based applications while also assisting in the access of databases by using ActiveX data objects (ADO) while allowing programmers to use ActiveX control and various objects.
VB continued to evolve throughout the 1990s until Visual Basic 6 was released in 1998, which was replaced by VB .NET. However, Visual Basic for Applications, which is most commonly used today to automate Microsoft Office tasks, is highly compatible with the classic VB 6.
I'm hoping someone from esri can shed some light on some simple coding style. As requested in this idea there is a remarkable lack of sample code in Visual Basic. I've spent much of my career using VB and ArcObjects in ArcMap and now facing the challenge of developing in ArcPro. I would like to avoid having to sink months/possibly years into becoming proficient in c# when I know VB!
I understand that beneath the hood ArcPro is a very different beast requiring different coding styles because of its multi-threaded nature and that many things have to be done differently. That's OK when simple, easy to digest samples are provided to fast track ones self.
Thanks for the pointer to the website. I had actually seen this thread before I posted (i.e. had done my research) and followed the link to the code conversion website and tried their example; problem was is when you paste it into visual studio 2022 it throws an error but gives no real indication why. In my random stumbling around in the vastness of the internet I had seen some comment, probably on this forum, about what seems to be an undocumented addition to the code that needs to be done if you are developing a button for the ArcPro ribbon and that's the inclusion of the command "Async" in the OnClick Sub declaration. I've posted the solution over on GIS StackExchange but provide it here too. It provides a simple VISUAL BASIC template for building code that requires running as a QueuedTask.
If there is anyone from the ESRI documentation team reading this, it would be good if you expand your snippets on the GITHUB site to include some sample code in Visual Basic. Why has ESRI abandoned VB? When you go to the esri git hub site and search for code language in VB it returns nothing!
VB is considered an event-driven language that is easy to learn and write code. It is designed to foster rapid application development (RAD), where the application prototype can be developed first with less focus on writing complex codes in the initial stages of the development cycle.
RAD employs adaptive software development where the developers prioritize building prototypes rather than software planning. As a result, professionals can quickly make multiple iterations and introduce software updates in quick time without writing difficult codes from scratch.
Unlike other programming languages, BASIC language incorporated several common English words into its syntax. This made the language more user-friendly as end-users found it easier to learn and remember. This was one of the fundamental reasons Microsoft wanted to derive another programming language rooted in BASIC.
Because of its ease of use, simple syntax, and visual tools, VB is still ranked among the top 25 popular programming languages worldwide. According to March 2023 statistics from PYPL (PopularitY of Programming Language), VB is ranked 21st in the popularity index with 0.53% of the market share.
The VB application is ready for use when all the UI elements, subroutines, and other software codes are put together in the project. Thus, the programmer can run the application using one of the following ways:
While the above steps define the working of the initial version of VB, its workflow varies depending on the version you use. For instance, if you use Visual Basic .Net, its implementation in Visual Studio is similar to BASIC language, with added syntax elements and features stemming from Object Pascal and C language. The VB code is compiled into the object code and then coupled to parts of your application to create a .exe file. This file can run independently without needing a Visual Studio environment, just like any other app on your machine.
If you use the VBA version of VB, the code is typically written in the IDEs built into Microsoft Office programs such as MS Access, MS Excel, MS Word, etc. In VBA, the code is tokenized, compiled, and executed in a virtual machine in the Microsoft Office application. VBA code cannot be executed outside the Office environment. Thus, VBA cannot generate .exe files on its own.
The initial installation of VB requires a substantially large amount of memory. As the language provides a GUI-based development kit, it inevitably demands much space. Moreover, with VB, it is not feasible to initialize structures at declaration time, which is possible in C language. Also, the development environment suits programs requiring less processing time.
3a8082e126