ReDim statement
Level in the process to declare dynamic array variables and allocate or reallocate storage space.
ReDim [Preserve] varname (subscripts) [, varname (subscripts)]...
Parameter
Preserve
When changing an existing one-dimensional array of the size of the final to retain the data.
varname
Variable name, follow the standard variable naming conventions.
subscripts
Dimension of the array variable, up to 60-dimensional array declaration. subscripts parameter syntax is as follows:
upper [,upper] . . .
The lower bound of the array is always zero.
Explain
ReDim 璇彞閫氬父鐢ㄤ簬鎸囧畾鎴栦慨鏀瑰姩鎬佹暟缁勭殑澶у皬锛岃繖浜涙暟缁勫凡鐢ㄥ甫鏈夌┖鎷彿鐨?Private銆丳ublic 鎴?Dim 璇彞锛堟病鏈夌淮鏁颁笅鏍囷級姝e紡澹版槑杩囥? ReDim statement can be used repeatedly to change the array dimension and the number of elements.
If you use the Preserve keyword, you can adjust the size of the array the last dimension, and can not change the dimensions of the array.渚嬪锛屽鏋滄暟缁勫彧鏈変竴缁达紝灏卞彲浠ヤ慨鏀硅鏁扮粍鐨勫ぇ灏忥紝鍥犱负璇ョ淮鏄渶鍚庣殑涔熸槸浠呮湁鐨勪竴缁淬? However, if two or more dimensional array, it can only change the size and retain the end-dimensional array of content.
This example illustrates how not to erase the array of existing data, and increase the dynamic dimension of the array of termination.
ReDim X(10, 10, 10). . .ReDim Preserve X(10, 10, 15)
Be careful if the reduced size of the array, will be excluded from the element missing data.
Variable initialization, numerical variable is initialized to 0, the string variable initialized to zero-length string (). Using the reference object before the variables, you must use the Set statement to an existing object to give the variable.鍦ㄨ繘琛屽璞¤祴鍊间互鍓嶏紝宸插0鏄庣殑瀵硅薄鍙橀噺鏈夌壒瀹氬? Nothing銆?br />
相关链接:
FLV to 3GP
"Soldier of blood," the official version of the game experience and evaluation
3GP to WMV
U.S. export control policy toward China brewing adjustment
Report DICTIONARIES Education
"Five phone" in the standoff between China into the EARLY
Ci.dll error fixing tip
Bitmap Image Synthesis Model And Channel Together
Acer suggest possible purchase Packard Bell is actively brewing
Listed company s three key financial indicators
Easy News Servers
MOD to MPG
Common JSP Title 8: JSP's basic concepts
No comments:
Post a Comment