Hello,
Why does the following code seem to slow down exponentialy? If I
substitute the variable "mytype" with a long, the program seems to
run at a steady speed...
Does this have anything to do with the "preserve" feature of redim?
------------------
Cheers
Why does the following code seem to slow down exponentialy? If I
substitute the variable "mytype" with a long, the program seems to
run at a steady speed...
Does this have anything to do with the "preserve" feature of redim?
Code:
#compile exe #include "win32api.inc" type mytype n as string * 4096 end type function pbmain as long dim result as long dim hdlg as long dim lut() as mytype dim i as long dialog new 0,"test",1,1,256,64,%WS_POPUP or %WS_CAPTION or %WS_SYSMENU to hdlg control add label,hdlg,100,"",4,4,200,12 control add label,hdlg,200,"",4,18,200,12 dialog show modeless hdlg dialog doevents to result for i = 0 to 100000 redim preserve lut(i) if int(i mod 10) = 0 then dialog doevents to result if (result = 0) then exit for control set text hdlg,100,format$(i,"array reallocated(#)") end if next i do until result = 0 dialog doevents to result loop end function
------------------
Cheers
Comment