1. Prevent the program from being run repeatedly. If you don’t want your VB application to be run repeatedly by others by double-clicking the icon multiple times, resulting in insufficient memory or other accidents, you can add the following lines to the program:
PRivateSubForm_Load
ifappprevinstancethen
msgbox "The program is running, please check whether the window is minimized."
endif
EndSub
2. Use the Ucase function to ensure the correctness of file operations. Under the WIN32 platform, file names are generally lowercase letters, but on the WIN95 platform, uppercase letters sometimes appear. In order to ensure that programs involving file operations developed with VB3 under the WIN32 platform can also work normally on the WIN95 platform, you can use the Ucase function to convert the case of the file name. For example: when using VB3 to develop a media browser under the WIN32 platform, you can use the following program segment to achieve automatic playback, regardless of whether the file suffix is uppercase "AVI", "WAV", "MID", or lowercase "avi" , "wav", "mid", or mixed case:
SubFile1_Click()
MMcontrol1filename=File1Path&″/″&File1filename
t=Ucase(Right(File1filename,3))
Ift=″AVI″Ort=″WAV″Ort=″MID″Then
MMcontrol1Command=”close”
MMcontrol1Command=”play”
Endif
EndSub
3. The length of each Chinese character in VB5 is 1 instead of 2. The length of each Chinese character in VB3 is 2, while the length of each Chinese character in VB4 and VB5 is 1. Special attention needs to be paid when intercepting substrings of Chinese character strings. This change brings greater convenience to the design of sorting, retrieval, and filtering programs for Chinese characters. In addition, the ASCII codes of Chinese characters in VB5 are less than 0, while in VB3 or C++, the ASCII codes of Chinese characters are greater than zero. ->