Learning information:
Ibjecty method (Event) event (event)
Data type
Data type type declaration character DIM INTINCOME%
SINGLE! DOUBLE #INTeger% Long & String $
Data type prefix data type prefix Char Chr Double DBLSTRING STR BOOLEAN BLNSHORT SHT OBJECT OBJINTEGER INT DCMAL DCMLONG LNG DATE DTSINGLE SNG BYTE BYT
Data type char 2BYTES ?? Character ????? 0 to 65535 STRING 10BYTES? String ?? 0 to approximately 2 million dual characters (2 multiply string length) (unicode) SHORT 2BYTES ?? ?? -32,768 32,767Integer 4Bytes? ?? integer from 2,147,483,648 to 2,147,483,647Long 8Bytes? ?? -9,223,372,036,854,775,808 long integer into single precision floating point 9,223,372,036,854,775,807Single 4Bytes ?? ?? -3.402823E38 to the negative part of the positive -1.401298E-45 the number of part 1.401298E-45 to 3.402823E38Double 8Bytes? double precision floating ?? negative part -1.79769313486231E308 to -4.94065645841247E-324, positive part of 4.94065645841247E-323 to 1.79769313486232E308 points Boolean 4Bytes? ?? True or Boolean FalseObject 4Bytes ??? ?? object can be stored in any type decimal 12Byes target value ?? variable patterns not more than /- 79,228,162,514,264,337,593,543,950,335 decimal, the decimal can be saved if the tape 28 as a minimum 7.9228162514264337593543950335 /- /-0.000000000000000000000000000000000000000000000 0000001DATE 8BYTES? Date? No. 1 January 1st to December 31, 9999 BYTE 1BYTE Bit 0 to 255
DIM variable name [AS data type]
DIM STRUSERNAME AS STRING = "charles"
Const constant name [AS data type] = specified value
DIM array name (number of elements) [AS data type]
DIM array name () [AS data type] = {value 1, value 2, value 3, ...}
The number of VB.NET array elements can be declared to 264-1 elements (ie the range of long-type) VB.NET supports an array of 64-dimensional arrays.
Variable = Request ("Parameter Name")
Data type other conversion type
Changed CBOOL ??? BooleancByte ?? BYTECCHAR ?? chartcdate ?? Datecdbl ?? DoublecDec ?? Decimalcint ??? INTEGERCLNG ?? longcobj ?? Objectcshort ?? SHORTCSNG ??? Singlecstr ?? String
Use TO to convert
Variable = variable. TO type or variable = (narrative) .TO type
The following table is a commonly used TO type conversion method: conversion type usage method turnt strings toString () numerical turntable TOCHAR () string turn-write TOLOWER () string turn large write TouPper () Transfer Jumi TOINT16 () Transfer TOINT32 () Directivity TETION TOINT64 () Totter Todecimal () Turns TodateTime () Transfusion TODATETIME () Transfusion TodouBle () Transder TODOUBLE () Date Toboolean () Date Transfer Day ToshortdateString () Time Transfer Time ToshortTimeString () Note VB.NET has two labels, one is to use single quotes "'", and the other is to use REM keywords. For the annotation of the use of the row, the last line of the narrative is correct.
There are three programs in the type VB.NET of the program, which are general programs, event programs, and properties.
General procedures refer to SUB or FUNCTION, which can help us make complex programs to make many easy-to-manage units; and event programs are triggered to respond to the operations performed by the system or user.
The program written in sub-way has no transmission value, that is, the result of the execution will not be transmitted. Let's take a look at the syntax of the SUB: SUB program name (parameter 1 AS type, parameter 2 AS type, ...) program code ... END SUB
The program written in the function of function has a transmission value, that is, the result of the execution, so it must be received with a variable or object attribute when calling function. Function program name (parameter 1 AS type, parameter 2 AS type, ...) program code ... RETURN pass-back value end function
Whether it is a general program or an event program must be labeled by Script