We can create a Asc to Chr and Chr to Asc converter in VB. Let’s examine the following Example:
In this example, we create two buttons, label one of them as ASC and the other one as CHR. Insert two textboxes, one for the user to enter an ASC code and the other one to enter the CHR character. When the user enter an ASC code, he or she can check for the corresponding character by clicking the CHR button. Likewise, he or she can check the corresponding ASC code after entering a character.
Private Sub CmdASC_Click()
TxtASC.Text = Asc(TxtCHR.Text)
Private Sub CmdCHR_Click()
TxtCHR.Text = Chr(TxtASC.Text)
Please refer to the following article for more details.
Array size is often defined during design time. This type of array is known as static array. However, the problem is sometimes we might not know how many data items we need to store during run time. In this case, we need to use dynamic array where the number of elements will be decided during run time. In Visual Basic 2017, the dynamic array can be resized when the program is executing. The first step in declaring a dynamic array is by using the Dim statement without specifying the dimension list, as follows:
Then at run time we can specify the actual array size using the ReDim statement,as follows:
* n =array size
You can also declare a two dimensional array using ReDim statement, as follows:
ReDim myArray(n, m)
*mxn indicates the array size.
Read more here
The String function has two arguments, a number and a single-character string, and returns a string consisting of the specified character repeated the speficified number of times. Follow the link below to read more.
Our Visual Basic 2017 tutorial is finally ready!
Start learning Visual Basic 2017 by clicking the link below:
To start programming in Visual Basic 2017, you need to launch Visual Studio 2017 RC. The following is the start page of Visual Studio 2017.
Click on project and the New Project window opens. Select Visual Basic and choose Windows Forms App(.NET Framework) as shown in the figure below. Also enter the project name and then click OK.
After clicking OK, You will be presented with the Visual Basic 2017 IDE,as shown in the figure below. The VB2017 IDE comprises a windows form, the Solution Explorer, the Properties window and the toolbox.
To start programming, click on the form to bring up the code window.
The first program you can write is to enter the following code:
MsgBox(“Welcome to Visual Basic 2017”)
Running the program will produce a message box that shows the message “Welcome to Visual Basic 2017”