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
 How to add userparameter rows using loop ?

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
deepakdinakaran Posted - 01/16/2019 : 10:51:36 AM
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2018 SR1
Operating System:Windows 8.1

Hello,

I use the following script to rearrange data from sheet 1 to Device1,Device2 (newly created sheets). Now, I would like to do the same thing but I would like to insert the data from sheet 1 into userParameter rows as in sheet2.

I tried using wks.UserParam1=1; to create a userparameter row but I could not used it inside the for loop.

range asheet=[%H]$(page.active);
nc=wks.nCols;
nr=wks.maxRows;
for(ir=1;ir<=nr;ir++){
bauteil$=asheet!col(1)[ir]$;
newsheet name:=bauteil$;
range ss = [%H]bauteil$!wcol(2);
for(ii=1,ic=2;ii<=(nc-1) && ic<=nc;ii++,ic++){
tem$=asheet!wcol(ic)[L]$;
ss!col(A)[ii]$=tem$;
ss[C]$=bauteil$;
ss[ii]$=asheet!wcol(ic)[ir]$;
}
}

Thanks in advance.
Best regards,
Deepak

4   L A T E S T    R E P L I E S    (Newest First)
deepakdinakaran Posted - 01/18/2019 : 05:11:07 AM
Hi Yuki,

Perfect. It worked. Thank you.

Regards,
Deepak




quote:
Originally posted by yuki_wu

Hi Deepak,

You are quite close to the answer, you could use the script like:

loop(ii, 1, 5)
{
wks.userParam$(ii)=1;
}

Hope it helps.

Regards,
Yuki

OriginLab


yuki_wu Posted - 01/18/2019 : 04:04:57 AM
Hi Deepak,

You are quite close to the answer, you could use the script like:

loop(ii, 1, 5)
{
wks.userParam$(ii)=1;
}

Hope it helps.

Regards,
Yuki

OriginLab
deepakdinakaran Posted - 01/17/2019 : 07:47:42 AM
Hi Yuki,

Thanks for your suggestion. I think the page you suggested only explains about creating a userparameter row (command is wks.UserParam1=1;) but i am interested in doing the same inside a for loop. I want to create n number of userparamter rows depending on the iteration.

For example, if we assume the command for creating userparameter row is wks.UserParam[ii]=1, i can use this inside a for loop for creating n number of userparameters rows. But since the command is wks.UserParameter1=1 (this command creates a single row), is there other ways to use them inside a for loop ?

Thanks and best regards,
Deepak



quote:
Originally posted by yuki_wu

Hi Deepak,

Please try to take a look at this page, it should help:
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#Read.2FWrite_Column_Label_Rows

Regards,
Yuki

OriginLab


yuki_wu Posted - 01/16/2019 : 10:06:15 PM
Hi Deepak,

Please try to take a look at this page, it should help:
https://www.originlab.com/doc/LabTalk/guide/Accessing-Metadata#Read.2FWrite_Column_Label_Rows

Regards,
Yuki

OriginLab

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