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
 How to add userparameter rows using loop ?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

deepakdinakaran

India
14 Posts

Posted - 01/16/2019 :  10:51:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

yuki_wu

896 Posts

Posted - 01/16/2019 :  10:06:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

deepakdinakaran

India
14 Posts

Posted - 01/17/2019 :  07:47:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page

yuki_wu

896 Posts

Posted - 01/18/2019 :  04:04:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

deepakdinakaran

India
14 Posts

Posted - 01/18/2019 :  05:11:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


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