Sign in to follow this  
Followers 0
strate

Redim a dynamic three dimensional array

4 posts in this topic

I've been trying to get this one on my own, but it isn't happening. My problem is redim and Ubound, I'm not really sure how to do it. If I do it such as:

$TreeView[UBound($TreeView,1)][UBound($TreeView,2)-1][UBound($TreeView,3)]oÝ÷ Ú+^®º+±«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±ÐíÉÉä¹ÔÌÐì(¥¹±Õ±Ðí¥±¹ÔÌÐì()±½°ÀÌØí}½É±±M¡Õ±(ÀÌØíÍ}½É±±M¡Õ±ôÌäíèÀäÈí½É±°M¡Õ±¹ÑáÐÌäì((ÀÌØí}   ½áÌô}ÉÉå
ÉÑ ÄÌÌÌÐØ°ÄÌÌÌÜÀ°ÄÌÌÌÐÜ°ÄØÐÈÈØ°ÄÌÌÌÐà¤)}¥±IQ½ÉÉä ÀÌØíÍ}½É±±M¡Õ±°ÀÌØí}½É±±M¡Õ±¤(ÀÌØí}ÕÑÌô}ÑÕÑÌ ÀÌØí}½É±±M¡Õ±¤(((I¥½¸MQIP-½U$ÍÑ¥½¸½É´ô(ÀÌØí½É´ÄôU%
ÉÑ ÅÕ½Ðí½É±°=ÁÑ¥µ¥éÑ¥½¸ÅÕ½Ðì°ÌÜÜ°ÌÜÀ°ÄäÌ°ÄÄÔ¤(ÀÌØíQÉY¥ÜÄôU%
Ñɱ
ÉÑQÉY¥Ü ÄØ°ÄØ°ÈÀÄ°ÌÌܤ()¥´ÀÌØíQÉY¥ÝlÅulÅulÅt)½ÈÀÌØí¤ôÀQ¼U½Õ¹ ÀÌØí}  ½á̤´Ä($(%I¥´ÀÌØíQÉY¥ÝmU ½Õ¹ ÀÌØíQÉY¥Ü°Ä¤¬ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°È¤¬ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°Ì¤¬Åt($ÀÌØíQÉY¥ÝmU  ½Õ¹ ÀÌØíQÉY¥Ü°Ä¤´ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°È¤´ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°Ì¤´ÅtôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÀÌØí} ½áÍlÀÌØí¥t°ÀÌØíQÉY¥ÜĤ(%½ÈÀÌØí¥¤ôÄQ¼U½Õ¹ ÀÌØí}ÕÑ̤´Ä($$($%I¥´ÀÌØíQÉY¥ÝmU ½Õ¹ ÀÌØíQÉY¥Ü°Ä¥umU    ½Õ¹ ÀÌØíQÉY¥Ü°È¤¬ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°Ì¥t($$ÀÌØíQÉY¥ÝmU ½Õ¹ ÀÌØíQÉY¥Ü°Ä¥umU    ½Õ¹ ÀÌØíQÉY¥Ü°È¤´ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°Ì¥tôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÝmU    ½Õ¹ ÀÌØíQÉY¥Ü°Ä¤´ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°È¤´ÅumU    ½Õ¹ ÀÌØíQÉY¥Ü°Ì¤´Åt¤($$(íø$ì$ÀÌØíQÉY¥ÝlÀÌØí¥ulÅulÅtôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÝlÀÌØí¥ulÅulÁt¤(%9áÐ)9áÐ((íøÀÌØíQÉY¥ÜÅ|ÀôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐìÄÌÌÌÐØÅÕ½Ðì°ÀÌØíQÉY¥ÜĤ(íøÀÌØíQÉY¥ÜÅ|ÄôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|À¤(íøÀÌØíQÉY¥ÜÅ|ÈôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|Ĥ(íøÀÌØíQÉY¥ÜÅ|ÌôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐìÄÌÌÌÜÀÅÕ½Ðì°ÀÌØíQÉY¥ÜĤ(íøÀÌØíQÉY¥ÜÅ|ÐôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|̤(íøÀÌØíQÉY¥ÜÅ|ÔôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|Ф(íøÀÌØíQÉY¥ÜÅ|ØôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐìÄÌÌÌÐÜÅÕ½Ðì°ÀÌØíQÉY¥ÜĤ(íøÀÌØíQÉY¥ÜÅ|ÜôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|ؤ(íøÀÌØíQÉY¥ÜÅ|àôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|ܤ(íøÀÌØíQÉY¥ÜÅ|äôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐìÄØÐÈÈØÅÕ½Ðì°ÀÌØíQÉY¥ÜĤ(íøÀÌØíQÉY¥ÜÅ|ÄÀôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|ä¤(íøÀÌØíQÉY¥ÜÅ|ÄÄôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|ÄÀ¤(íøÀÌØíQÉY¥ÜÅ|ÄÈôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐìÄÌÌÌÐàÅÕ½Ðì°ÀÌØíQÉY¥ÜĤ(íøÀÌØíQÉY¥ÜÅ|ÄÌôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|ÄȤ(íøÀÌØíQÉY¥ÜÅ|ÄÐôU%
Ñɱ
ÉÑQÉY¥Ý%Ñ´ ÅÕ½ÐíÑÅÕ½Ðì°ÀÌØíQÉY¥ÜÅ|Ä̤(ÀÌØí    ÕÑѽ¸ÄôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíAÉ¥¹ÐÅÕ½Ðì°ÈÔØ°ÄØ°àÄ°ÄÜ°À¤(ÀÌØí   ÕÑѽ¸ÈôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½ÐíY¥ÜÅÕ½Ðì°ÈÔØ°Ðà°àÄ°ÄÜ°À¤)U%MÑMÑÑ¡M]}M!=¤(¹I¥½¸9-½U$ÍÑ¥½¸()]¡¥±Ä($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($%
ÍÀÌØíU%}Y9Q}
1=M($$%á¥Ð((%¹MÝ¥Ñ )]¹()á¥Ð()Õ¹}ÉÉåIµ½ÙÕÁÌ ÀÌØí%¹ÉÉä¤(1½°ÀÌØíQµÁÉÉäôÌäìÌäì(½ÈÀÌØí¤ôÀQ¼U  ½Õ¹ ÀÌØí%¹ÉÉ䤴Ä(ÀÌØíÉÈô}ÉÉåMÉ  ÀÌØíQµÁÉÉä°ÀÌØí%¹ÉÉålÀÌØí¥t¤ô´Ä(M±Ð($$%
ÍÉɽÈôÄ(ÀÌØíQµÁÉÉäô}ÉÉå
ÉÑ ÀÌØí%¹ÉÉålÀÌØí¥t¤(
ÍÉɽÈôØ(}ÉÉå ÀÌØíQµÁÉÉä°ÀÌØí%¹ÉÉålÀÌØí¥t¤($%¹M±Ð(9áÐ($ÀÌØíQµÁÉÉålÁtôU ½Õ¹ ÀÌØíQµÁÉÉ䤴Ä(IÑÕɸ ÀÌØíQµÁÉÉä¤)¹Õ¹ìôôÐí}ÉÉåIµ½ÙÕÁÌ()Õ¹}ÑÕÑÌ ÀÌØí}½É±±M¡Õ±¤(%¥´ÀÌØí}ÕÑÍlÅt(%½ÈÀÌØí¤ôÄQ¼U    ½Õ¹ ÀÌØí}½É±±M¡Õ±¤´Ä($$ÀÌØí}M¡Õ±1¥¹ôMÑÉ¥¹MÁ±¥Ð ÀÌØí}½É±±M¡Õ±lÀÌØí¥t°ÌäìÌäì¤(íø$%
½¹Í½±]É¥Ñ ÌäíÕ ÔÔ¤èÀÌØí}M¡Õ±1¥¹lÉtôÌäìµÀìÀÌØí}M¡Õ±1¥¹lÉtµÀì±µÀìÌäìÐíÉɽȽèÌäìµÀìÉɽȵÀ챤ìÕ
½¹Í½±($%I¥´ÀÌØí}ÕÑÍmU ½Õ¹ ÀÌØí}ÕÑ̤¬Åt($$ÀÌØí}ÕÑÍmU   ½Õ¹ ÀÌØí}ÕÑ̤´ÅtôÀÌØí}M¡Õ±1¥¹lÉt(%9áÐ(íø%}ÉÉå¥ÍÁ±ä ÀÌØí}ÕÑÌ°ÌäìÀÌØí}ÕÑÌÌäì¤($ÀÌØí}ÕÑÌô}ÉÉåIµ½ÙÕÁÌ ÀÌØí}ÕÑ̤(íø%}ÉÉå¥ÍÁ±ä ÀÌØí}ÕÑÌ°ÌäìÀÌØí}ÕÑÌÌäì¤(%IÑÕɸÀÌØí}ÕÑÌ)¹Õ¹((

INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites



Well this dont get me an error

Dim $TreeView[2][2][2]
$TreeView[0][0][0] = 2
$TreeView[0][0][1] = 2
$TreeView[0][1][0] = 2
$TreeView[0][1][1] = 2
$TreeView[1][0][0] = 2
$TreeView[1][0][1] = 2
$TreeView[1][1][0] = 2
$TreeView[1][1][1] = 2
ReDim $TreeView[UBound($TreeView,1)][UBound($TreeView,2)-1][UBound($TreeView,3)]

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

I'm not having a problem with the initial redim its the second part of the process, when you bring it back down.

ReDim $TreeView[UBound($TreeView,1)+1][UBound($TreeView,2)][UBound($TreeView,3)]
$TreeView[UBound($TreeView,1)-1][UBound($TreeView,2)][UBound($TreeView,3)] = GUICtrlCreateTreeViewItem($a_Boxes[$i], $TreeView1)

I get a "Array variable has incorrect number of subscripts or subscript dimension range exceeded."


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

Share this post


Link to post
Share on other sites

Well one of the variables might get to small (0) and then it fails... Try to debug with

ControlWrite and show the numbers it shall converts to like this

ConsoleWrite("1dim: " & UBound($TreeView,1) & " 2dim: " & UBound($TreeView,2)-1 & " 3dim: " & UBound($TreeView,3) & @CRLF)
ReDim $TreeView[UBound($TreeView,1)][UBound($TreeView,2)-1][UBound($TreeView,3)]

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0