Hi
I got a two dimension array with 50 on 150 elements.
I created a for function to query data and place in in a new array to present in report view dialog:
for i2w = FromH to nRmax1-1
for j2w = 0 to nCmax1-1
LastRunFromEDRDB = EDRDBArr[i2w,0]
RTOfromEDRDB = EDRDBArr[i2w,32]
LastResfromEDRDB = EDRDBArr[i2w,42]
next
if LastRunFromEDRDB == LastTimeRunDDMMYYFromI then
break
else
LastResfromEDRDB = "No data"
RTOfromEDRDB = "No data"
end if
next
It take up to 1 minute for the function to complete.
I know that working with Array is very fast.
Am i doing something wrong?
Thanks
Why are you using a nested loop? You are only accessing three columns of each row and not every column of every row. Your script as written has 7500 loop iterations when it only needs 150 (assuming 150 rows with 50 columns per row.)
Hi
Yes, that solved it, it is much quicker now...
Thanks