Integer is a signed short integer with 2 bytes, which can represent the range from -32768 to 32767.
Long is a long integer. 4 bytes, which can represent about-2 billion to 2 billion.
All the above are integers.
Single is a single-precision floating-point type (that is, with decimal point), with 4 bytes.
Double is a double-precision floating-point type with 8 bytes. These two storage methods are a little more complicated.
String is a string, but it is not a real basic data type. It is a one-dimensional array composed of a certain number of bytes (characters or double characters). To understand what a string is, you must know the character encoding.
As for the use, it depends on the algorithm, which is actually the implementation method. The algorithm depends on the actual functional requirements, for example, if you want to count the number of members, if you use integer, you can only have 32,767 members, and your system will collapse if you have more.
In addition, some built-in functions (including api) agreed by vb use specific parameters, so this type can only be used.
Of course, byval passing vb will automatically convert data types, such as
private
submarine
Command 1_click (index
be like
Integer)
The index of the control array must be an integer.
list 1.list( 1)
=
“abc”
The item index of "listbox" must be an integer.
text 1
=
Space (10)
The spatial parameters are very long.
if
getdesktopwindow()
& lt& gt
me.hwnd
then
The window handle is very long.
I know you have a lot of questions, you can ask them directly, but let me tell you first that to be an excellent programmer, you must go through hard work, study hard, be good at summing up and be diligent in thinking. In fact, in any case, if you want to work harder than others, you must work harder than others.