Dim cube(7999999) As Integer for i=1 to 200 for j=1 to 200 for k=1 to 200 'my code next next next 这样可以吧。
8M,现在的内存随便都是1G以上的,应该没问题吧。你要是定义个1G大的数组(不管多少维),也许就不能保证正常了。VB会在连续内存上分配数组,要是你随有2G的内存,却没有连续的1G大的内存,那就惨了。比如dim a(10*1024,10*1024)as long成功dim a(11*1024,10*1024)as long失败但是 dim a(10*1024,10*1024)as long,b(5*1024,10*1024) as long 竟然成功了
for i=1 to 200
for j=1 to 200
for k=1 to 200
'my code
next
next
next
这样可以吧。
dim a(10*1024,10*1024)as long,b(5*1024,10*1024) as long 竟然成功了