VB Programming experience Novel

Source: Internet
Author: User
Tags definition variables
Programming
//********************************************************
In Rect type definition declarations, the order of precedence and encoding is different in the definition. Be careful.

The string you get with the API function is finally a null character. That is, Chr (0), you should pay attention when manipulating strings.

u use Len (string) >0 than Len (string) <> "" good. Fast.

You can usually IIf function compression code.

In the U//for...next Loop, the value of the loop variable is [end value +1]

U//Various controls have a default value that can be used to reduce the amount of code. and improve efficiency

You can effectively reduce the amount of code by using control variables.//make use of the special variable as much as possible and use less common variables. Private variables occupy less resources.

Be sure to follow the rules of variable naming. Otherwise you'll regret it. (Standard can see Hungarian nomenclature + add own custom)

Even if the program is very small, or never give people to see and don't do this
Don't name it for 00X of resources. 1:24 2003-4-24
When using a string function, add the $ number. such as left$ (), otherwise the function is treated as a variant type.
Use integral type as much as possible, long integral type ... Less character type (very slow processing characters)
There is no need to use the ^ to multiply
Note that you should strictly control the use of static variables. Because the static variable frees up memory until the program exits.
Always check the value of the static variable to avoid affecting the data that you are currently working on, or future data.

//*********************************************

Various controls have a default value that can be used to reduce the amount of code. and improve efficiency
such as textbox= "Me" is equal to textbox.text= "Me"
Checkbox =value
CommandButton =value
Option Button =value
Horizontal ScrollBar =value
Vertical scroll bar =value
//*******************************************
ComboBox =text
Textbox =text
Grid =text
ListBox =text
Date =caption
Frame =caption
Label =caption
Menu =enable
Timer =enable

"" After the program to strictly implement the following provisions, the purpose of doing so, in order to facilitate the maintenance. Reduce the amount of work that is caused by maintenance and upgrades.
= = Data type abbreviation
integer int
Long-complete LNG
Character Type Str
Boolean Boo
Single Precision SNG
Double Precision Dub
BYTE type bit
Date-Type dat
Currency type cur
Object-Type obj
Variant type var
Self-stereotyped UDT
Array arr
Handle HND
Scene HDC
Error Object Err

Hnd,hdc are all of the long type. But for the convenience of LNG, you can also use a variable prefix such as. hnd,hdc. 1
Others like HND, in fact, is not too good, would like to use the HWND better. More versatile.
I sometimes don't want to play one more character. If it's not a prefix, I'd prefer to use a letter.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.