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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 wrcopy

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
maarnts Posted - 09/30/2013 : 06:21:08 AM
Origin 8.063.988 SR6
Operating System winXP:

I want to copy rows from one workbook_1 to another workbook_2
at a specific row number in workbook_2

I try to use the Xfunction wrcopy via labtalk.
However when I include the dr1:= option I get an error message
"Error: cannot find a (unique) variable corresponding to dr1"

When looking at the Xfunction code there seems no dr1 declared at all.
When excluding the dr1 function works perfect, but the row is always pasted at the first row of workbook_2.

Could you please help me with this problem?


3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/01/2013 : 5:04:59 PM
If your Dates (or Times) are formatted as Date (or Time) then they get treated as numerical values and are copied. If your Date values are NOT formatted as Date, then they will appear left-justified in a cell (like text). We of course recommend you do format any column with date values to be a Date format.

When copied, if the target column is not formatted as a Date then you will see Julian Day numbers, e.g. in the two million range.

A more general solution - one that works with Text as well - is a script that copies everything as text. Here is the script equivalent of the single copydata example I gave:

range rab1 = [Book1]Sheet1;
range rab2 = [Book2]Sheet1;
for(icol=2;icol<=4;icol++)
{
for(irow=8;irow<=12;irow++)
{
rab2!cell(3+irow-8,6+icol-2)$ = rab1!cell(irow,icol)$;
}
}

This assumes that all columns that will receive text are formatted as Text or Text&Numeric. A limitation here is that numeric values (or formatted Date values) copy only using display precision so you should set your source data to use maximum display precision.
maarnts Posted - 09/30/2013 : 11:01:11 AM
Unfortunately this workaround seems to work only for numeric data
(I have also text and dates in my data sets.)
greg Posted - 09/30/2013 : 10:28:26 AM
Your version does not have the dr1 option. That was added after we realized the function had very limited use without it. (Not sure which version added the dr1.)

You can use the copydata function which just deals with continuous data ranges (and no labels) as in:

copydata irng:=[Book1]Sheet1!2:4[12] orng:=[Book2]Sheet1!6[3];

which copies the block of data from column 2, row 8 to column 4, row 12 in [Book1]Sheet1 to the block whose upper left is column 6, row 3 in [Book2]Sheet1.
Note that the target column must exist, but additional columns need not exist yet when the function executes.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000