VB programming experience novel

xiaoxiao2021-03-06  50

// ******************************************************** ******* In the Rect Type Definition, the order in the definition is different from the order of the encoding. It is different. To strictly pay attention to the string obtained by using the API function. The last is a NULL character. That is, CHR (0), Be careful when operating a string .u with len (string)> 0 than LEN (string) <> "" "Good. Fast. U us can IIF function compression code .u //for...next cycle The value of the cyclic variable is [final value 1] u // all controls have a default value, appropriate use of codes to reduce the amount. And improve efficiency

u Using control variables can effectively reduce the amount of code. / Try to use special variables, less common variables. Special variables take up less resources. Be sure to comply with variable naming rules. Otherwise, you will regret it. (standard can see Hungar nomenclature Add your own habit) // Even if the program is small, or never give it to see if you don't see this // Don't take it for .00X's resource, you will be named 1:24 2003-4-24 // When using a string function Plus $ number. If left $ (), otherwise the function will be processed as a Variant type. // Try to use integer, long integer ... less characters (processing characters very slow) // No need to use ^ Has, and use * Multipline // Note To strictly control the use of Static variables. Because the Static variable is to release the memory. / / To check the value of the Static variable, so as to avoid the current processing of yourself Or affect the data in the future.

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

// Various controls have a default value, properly use the amount of code. And improve the 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 daxt = text listbox = text date = caption frame = caption label = caption menu = enable timer = enable '' later programming should strictly implement the following regulations, the purpose of doing this, for future maintenance convenience Reduce the workload brought by maintenance and upgrade. == Data type abbreviation // integer INT // long integer LNG // character STR // Boolean BOO // single-precision SNG // Double precision DUB // One-type bit // date DAT / / currency CUR // Object type OBJ // Variable VAR // Customized UDT // Array Arr // Handle HND // Scene HDC // Error Object ERR

HND, HDC is a long-type. But for convenience, you can use LNG or similar to .HND, HDC, etc. A variable prefix. 1 // There are also some hnds, it is not too good, willing to Better with hwnd. More general .// I am not willing to make more characters. If it is not a prefix, I am more willing to use a letter.

转载请注明原文地址:https://www.9cbs.com/read-81744.html

New Post(0)