Wednesday, March 9, 2011

VBScript ReDim statement

ReDim statement

Level in the process to declare dynamic array variables and allocate or reallocate storage space.

ReDim [Preserve] varname (subscripts) [, varname (subscripts)]...


When changing an existing one-dimensional array of the size of the final to retain the data.


Variable name, follow the standard variable naming conventions.


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.

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 />

51 Tencent performed very strike a sticky

BlackBerry video format

Bug tracking process issues that need attention


New Computer Education

PHOTOSHOP Gourmet Series peanut butter cookies

DVD to MP3

Thoroughly transform UML 2.0

Picked Geography Education

aawservice exe error Clean up these errors

comparison Help TOOLS

VOB File

No comments:

Post a Comment