A command is a specific instruction given to a computer application to perform a task or function. When referring to a programming language, a command is a unique word/keyword used to perform a specific operation.
Unlike variables, which are named and defined within your code, command names are defined by the programming language itself and cannot be changed. Differences in the names and use of different commands are essentially what make one programming language different from another.
As a programmer, you may be able to accomplish the same task coding in either Python or Visual Basic, but the code involved would be completely different between the two projects because of the way each language defines and interprets commands. Visual Basic, like any other programming language, employs commands. In this article, you are going to learn more about Visual basic commands and how to use them in your code.
Visual Basic Commands
In Visual Basic programming there is a multitude of commands and it will not be possible to list all of them in this article. Few of them will be studied here just for the purpose of understanding how they function.
string refers to the string containing character as first letter whose ASCII code is to be found.
In this example we are going to look for the ASCII (American Standard Code Information Interchange) code of the first letter of the word “Happy" hoping that you are happy reading this article. The code will be written in an old version of a Visual Basic IDE (VB6) and a new version (VB.NET). The screenshot will be done just for this example. In the other examples we shall give only the expected outcome. Do the following:
Create a new project in your VB IDE (VB6 or VB.NET)
Double Click on the default form that has been created automatically in the project.
Write the following code in the “Form_Load" procedure that was created when you double-clicked on the form in the previous step.
code = Asc("Happy")
MsgBox "The ASCII code is " &amp;amp;amp; code
Screenshot from a VB.NET IDE
Screenshot from VB6 IDE
Note: This command can be useful when you have a problem with a key on your keyboard. For example if you have a problem with letter “H" on your keyboard, knowing that the ASCII code for “H" is 72 as seen in the example above, if you type ALT + 72 on a word processor or an IDE editor, that will give you letter “H" (or Alt + 104 for “h").
Returns a string character that corresponds to the ASCII code in the range 0-255. It is the reverse of the Asc function.