Programming fundamentals are almost same in every language. Program is a set of instructions written in any language that can me executed for any specific operation. Programming fundamentals about visual basics are actually related to keywords and syntax of code etc. Its very important to type right syntax in source code even we cant add a simple dot or dash in source code by putting aside basic syntax. We have to program exactly as the programming syntax is. If we don’t care about syntax and keywords our code will not work properly and also will generate run time errors. Run time error occurs when we write a code but there is a syntax error in it. So its very important to be familiar with basic syntax of source code and all its related functions.
While working on any project we use few logics to execute some specific operations. Logical errors often could not be detected by system compilers for example if we create a logic to add, multiply, divide, some number and their result. There could be a logical error as mathematical operation start calculations in a predefined sequence . Fist Multiply then Division and at last Addition will be occur as math logics. Wile programming when we write code for addition first it could be appear with wrong calculation results but our compiler and system will not detect it because its type of logical error. I mean error in our logic while creating logic for calculation. But the syntax errors could be easily detected at runtime. Lets learn more about syntax and coding standards in Visual Basic.
As you know visual basic is and event driven language. And we have to write code in specific event to execute the application when that specific even occurs.
Following types of statements are used in visual basic.
Keywords are reserved words for predefined operations. That words could not be used by developer for any other purpose like defining variables etc.
In a code window what you see here is already few lines written.
See the image below.
Private means that this code is only accessible in this form only private is a keyword here
Sub stands for subroutine in subroutine we have a set of instruction or our code this is also a keyword
End sub indicates the end of subroutine