Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the entry-level knowledge points of VB

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what are the basic knowledge points of VB". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

First, VB introductory course VB and Basic

VB is called "Visual Basic" because it uses the Basic language as its code, so they are inextricably linked. If you have studied Basic, you will feel very friendly to see the program structure of VB. However, as a new creature, VB also goes beyond the limits of Basic and has many of its own characteristics:

VB established a new variable type D D monetary variable, which can avoid the problem of numerical accumulation error caused by the use of real variable by using monetary variable with only two decimal places.

When VB calls a function (Function), it must be followed by a pair of parentheses after the function name.

VB re-regulates the scope of use of brandy, treating implied variables as global variables in Basic and local variables in VB.

The instruction statement (Declare) in VB supports only subroutines and invariant functions of the dynamic link library (DLL).

Using arrays, you must define them in advance with Dim or Redim.

II. Comments on the introductory course of VB

You must understand the role of annotations before using comment statements. Annotations are not only the interpretation of programs, but sometimes they are also very useful for program debugging. For example, you can use comments to shield a statement to observe changes and find problems and errors. Comment statements will be one of the most frequently used statements in programming in the future.

In VB, there are two kinds of comment statements, one is to use the "Rem" keyword, which is the same as the use of batch files in DOS, and the other is to use single quotes "'", for example:

The role of Dim an As String is consistent with that of Rem Dim an As String.

III. Branches of long sentences in the introduction to VB tutorial

In earlier versions, because no language such as C used ";" to separate statements from statements, VB statements had to be written on one line, but in later versions of VB, a long statement was divided into lines with the line separator "_".

IV. Conditional statements in the introductory course of VB

If you have learned any kind of programming, you will know that there are two kinds of statements that control its flow in the program, condition and loop, and VB is no exception. In fact, no matter which language, the condition and loop look the same, but each has its own rules.

In the conditional statement, let's first learn "If. Then." Statement.

Its general syntax is:

If Then... End If

After using too much Else, you will feel very inconvenient, and the program structure is not clear, so most languages have Select statements to help solve this problem.

Fifth, VB introductory tutorial Loop statement

Loop structure is an important structure in computer language. it is widely used. The simplest example is the function of accumulator, and it can also be used in exhaustive method. A more intuitive example is to repeat something a specified number of times. In this way, there is no need to enter the statement to be repeated many times, but through the loop structure, it is very convenient. There is a "for" loop statement in C language, and there is also a "For" keyword in VB, which has the same effect, except that the "For" statement of VB is easier to understand. Its format is:

For = To [Step] Next

VI. VB introduction course Operation

1. Mathematical operation

+: addition operation, also suitable for merging operations between strings.

Addition operation.

*: multiplication.

/: division.

\: divisible operation.

Mod: remainder operation. For example, a Mod b represents the remainder of a divisible by b.

^: exponentiation. A ^ B represents the power of B with An as the base.

two。 Relational operation

Relational operation, also known as comparison operation, represents the true or false of an inequality. VB provides a total of six operators, namely = (equal to), > (greater than), and = (greater than or equal to).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report