The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Range issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

touch41

16 Posts

Posted - 08/27/2012 :  12:34:43 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,
I have an issue with ranges that is puzzling me.
I want the script to copy the content of a range of cells in of two columns, and paste it into two other columns.

The code I tries is:

range aa = 1[1]:2[10];
range bb = 3[1]:4[10];
bb=aa;

So I want to copy the content of cells 1 to 10 of columns 1 and 2, into cells 1 to 10 of columns 3 and 4. Same book, same sheet.

If I run this, all I get is that the content of column 1 from cell 1 to cell 10, is copied into column 3.

What's wrong?

I've managed to keep working by using two single column assigments, but I'd prefer to learn how to deal with two dimensional ranges...

Thank you very much for your help!

Best,

Matteo



Origin Ver.8.5 and Service Release 1
Operating System: Windows 7 professional

JessieWoo

China
46 Posts

Posted - 08/28/2012 :  04:46:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Matteo

You can try the following code to copy aa to bb:
range aa = 1[1]:2[10];
range bb = 3[1]:4[10];
copydata aa bb;

Please refer to the following page for more detail of "copydata":
http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Copydata

Best Regard,
Jessie
Originlab Corp.
Go to Top of Page

touch41

16 Posts

Posted - 08/28/2012 :  09:20:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That actually works!
Thank you very much!:-)

Best,

Matteo


quote:
Originally posted by JessieWoo

Hi, Matteo

You can try the following code to copy aa to bb:
range aa = 1[1]:2[10];
range bb = 3[1]:4[10];
copydata aa bb;

Please refer to the following page for more detail of "copydata":
http://wiki.originlab.com/~originla/wiki2/index.php?title=X-Function:Copydata

Best Regard,
Jessie
Originlab Corp.


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000