Jump to content

Recommended Posts

Is there an efficient way of copying a whole array subset without using loops?

Say I have an array;

Dim $array[5][2000]

I want to copy the fith set of the first dimension to the fourth set:

$array[4]=$array[5]

or in matlab-like style,

$array(4,:whistle:=$array(5,:lmao:

without doing:

for $i=0 to 1999

$array[4][$i]=$array[5][$i]

next

thanks of you have the solution.

Link to post
Share on other sites

Hi,; no!

But if you are asking "has it been done" to be more efficient?; maybe;

my link in sig gives a vbs option which may be faster for big arrays; so you get

_ArraySwap2D($ar_FileReadArray2D,4, 5)oÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíÉÉäɹÔÌÐì)1½°ÀÌØíÑ¥µÄôQ¥µÉ%¹¥Ð ¤°ÀÌØíÉ}¥±IÉÉä°ÀÌØíÍ¥±¹µôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈí¹ÍÝÉ¥¹1¥¹ÍàȹÑáÐÅÕ½Ðì(ÀÌØíÉ}¥±IÉÉäôMÑÉ¥¹MÁ±¥Ð¡¥±I ÀÌØíÍ¥±¹µ¤°
H¤)1½°ÀÌØíÉ}¥±IÉÉäÉô}ÉÉäÉ
ÉÑɽµÉÉåMÐ ÀÌØíÉ}¥±IÉÉä°Ä°À°ÅÕ½ÐíðÅÕ½Ðì¤(ìͼ¥å½Ô¡Ù±ÉäÉÉÉä°ÀÌØíÉ}¥±IÉÉäÉÑ¡¸ì)}ÉÉå¥ÍÁ±ä ÀÌØíÉ}¥±IÉÉäÉ°ÅÕ½ÐíÐÍÝÀÅÕ½Ðì¤)}ÉÉåMÝÀÉ ÀÌØíÉ}¥±IÉÉäɰаԤ)}ÉÉå¥ÍÁ±ä ÀÌØíÉ}¥±IÉÉäÉ°ÅÕ½ÐíÐÍÝÀÅÕ½Ðì¤)Õ¹}ÉÉåMÝÀÉ¡    åIÀÌØíÉ}ÉÉäÉ°ÀÌØíɽÜÄ°ÀÌØíɽÜȤ(%1½°ÀÌØíÍ}ÉÉå1¥¹Ôô}ÉÉäÉQ¼ÅMÑÉ¥¹ ÀÌØíÉ}ÉÉäÉ°ÀÌØíɽÜÈ°ÅÕ½ÐìÅÕ½Ðì°À°Ä¤(%1½°ÀÌØíÍ}ÉÉå1¥¹Ðô}ÉÉäÉQ¼ÅMÑÉ¥¹ ÀÌØíÉ}ÉÉäÉ°ÀÌØíɽÜÄ°ÅÕ½ÐìÅÕ½Ðì°À°Ä¤(%}ÉÉåIÁ±ÉI½ÝMÐ ÀÌØíÉ}ÉÉäÉ°ÀÌØíÍ}ÉÉå1¥¹Ô°ÀÌØíɽÜĤ(%}ÉÉåIÁ±ÉI½ÝMÐ ÀÌØíÉ}ÉÉäÉ°ÀÌØíÍ}ÉÉå1¥¹Ð°ÀÌØíɽÜȤ)¹Õ¹ìôôÐí}ÉÉåMÝÀÉ
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...