erifash Posted June 29, 2005 Posted June 29, 2005 This function figures out how many dimensions there are in an array. I don't know if there already is a function like this but I searched all over. Here's the code: Func _ArrayDim(ByRef $aArray) If not IsArray($aArray) Then Return 0 If UBound($aArray, 2) Then Return 2 Return 1 EndFunc ...and here is the example: Dim $array1[1] Dim $array2[1][1] Dim $string = "" MsgBox(0, "1 dim array", _ArrayDim($array1)) MsgBox(0, "2 dim array", _ArrayDim($array2)) MsgBox(0, "string", _ArrayDim($string)) Hope you like it! Any comments or questions are greatly appreciated! My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver
sshrum Posted June 29, 2005 Posted June 29, 2005 Ubound($myArray,0) Note the ",0" Returns back dimension info of the ref'ed array. Sean Shrum :: http://www.shrum.net All my published AU3-based apps and utilities 'Make it idiot-proof, and someone will make a better idiot'
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now