2
VB.NET.
4.2.1. , ,
VB
( ) ( ). ( ), , , , , , .
, , VB, , () .. (), . , , , (, , ) , . , . , ( ). , , , () , , . , .
. , , .. , . VB , VB.
. , , , . , : , . .
(), - . , , , , , ..
, VB :
|
|
(A Z) (a z) ;
( ) ( ) ;
0 9;
_;
(, , );
, : +- */; \^ =><[ ] ().:{} & @;
, : <=, >=, <>.
VB () , , . , , : , , .
. :
, (, +, *) (, , );
() (, Sub, End, If);
, , , , , , ..;
, ..
.
. :
( ), ;
;
;
255 ;
, , ;
, ;
.
, (, Const, Do, For, If, While) , , , .
, ( ). , . , . (, ) , , , , . . , . , , ( ) ( ). , '' _ '' (), ; , : ().
|
|
. ' (). . . . , .
, , , . , () . , , , () . , (), , (, , ). , : () (). , ( ; ; ) , . , . VB : , , , . , True , 25 .
4.2.2. , ,
,
, . () :
;
, ;
, .
, , , . , :
. ( VB , );
33 ;
, , , ;
, ;
VB, ( , ).
, , , () . , . , , . , VB .
|
|
4.2.2-1 () VB. VB .NET Framework.
4.2.2-1
(.NET) | ||||
Short | 16 | -32768 32767 | Dim Birds As Short Birds = 12500 | (System. Int) |
UShort | 16 | 0 65535 | Dim Days As UShort Days = 55000 | (System.UInt) |
Integer | 32 | -2147483648 2147483647 | Dim InsectsAs Integer Insects = 37500000 | (System.Int32) |
UInteger | 32 | 0 4294967295 | Dim JoysAs UInteger Joys = 3000000000 | (System.UInt32) |
Long | 64 | -9223372036854775808 9223372036854775807 | Dim WorldPop As Long WorldPop = 4800000004 | (System.Int64) |
ULong | 64 | 0 18446744073709551615 | Dim Stars As ULong Stars= 180000000000000000 | (System.UInt64) |
Single | 32 | -3.402823538 3.402823538 | Dim PriceAs Single Price = 899.99 | . (System.Single) |
Double | 64 | -1.79769313486231308 1.79769313486231308 | Dim PiAs Double Pi = 3.1415926535 | . (System.Double) |
Decimal | 128 | . . 29 | Dim Debt As Decimal Debt =7600300.50 | . (System.Decimal) |
Byte | 8 | 0 255 | Dim RetKey As Byte RetKey = 13 | (System.Byte) |
SByte | 8 | -128 127 | Dim NegVal AsSByte NegVal = -20 | (System.SByte) |
Char | 16 | Unicode 0 - 65535 | Dim UChar AsChar UChar= "A" | (System.Char) |
String | 16 | 0 ≈ 2 Unicode | Dim Dog As String Dog ="pointer" | (System.String) |
Boolean | 16 | True False ( 0 False, True) | Dim FlagAs Boolean Flag = True | . (System.Boolean) |
Data | 64 | 1 0001 31 9999 | Dim Birthday As Date Birthday=#3/1/1963# | (System.DateTime) |
Object | 32 | , Object | Dim App As Object App = CreateObject _ ("Word.Application") | (System.Object) |
, , , , . , , . , , , . , , .
, VB . , , . .
|
|
, , . , Integer, Single, () . , , Single Double, . VB . VB , , ( ) : OptionExplicit n.
VB , Dim (Dim dimension ), As. , VB , .
Dim :
Dim _ As , _ As , |
, :
Dim LNameAs String Dim As Integer, b As Single Dim , d As Integer |
, LName , ; b , , , ; d , .
Dim, Private Public:
Private _ As , _ As Public _ As , _ As |
Dim, Private Public .
, , Private Public .
, ( =).
. , , , , . . :
= .
Res = 20.56 X1 = + 5 / sin(x^ 2) |
LName :
LName = "" |
, LName , .
,
Label1.Text = LName |
(Label 1) .
, , .
, LName .
4.2.2-1. , .
1) VS.
2) , 2.2-1.
2.2-1.
3) 2.2-1 (.4.2.2-1).
. . , BorderStyle Fixed3D.
. 4.2.2-1. 2.2-1
4) .
|
|
Button 1_ Click ().
5) Name, :
Dim Name As String Name = "" Label1.Text = Name Name =". " Label4.2.Text = Name |
. Name String, , Dim. VS Name , , , . VS , , .
, , , , - .
Name , . . , , .
Name
. ( , ). , , , . , , .
, , : , . , , .
6) , Form 1. vb [ ].
7) .
Button 2_ Click ().
8) , , End.
, . 4.2.2-2.
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object,_ ByVal e As System.EventArgs) Handles Button1.Click Dim LName As String LName = " ": Label1.Text = LName LName = " . ":Label4.2.Text = LName End Sub Private Sub Button2_Click(ByVal sender As System.Object,_ ByVal e As System.EventArgs) Handles Button4.2.Click End End Sub End Class |
. 4.2.2-2. 2.2-1
9) , .
10) , , . , .
11) .
: , , . ,
. 4.2.2-3.
. 4.2.2-3. 4.2.2-1
12) ,
.