I want to fix User Parameters using LT. For this purpose, I want to loop over visible User Parameters. To do this I need to get the total number of defined items.
How do I get User Parameter count?
Thanks.
--- Andrey
8 L A T E S T R E P L I E S (Newest First)
AKazak
Posted - 07/21/2021 : 05:53:48 AM
quote:Originally posted by cpyang
We added wks.UPC (user parameter count) for 2022, so it can be
loop(i,1,wks.upc) {wks.userparam$(i)$=;};
CP
Great idea! Looking forward to testing this.
--- Andrey
cpyang
Posted - 07/15/2021 : 5:49:54 PM We added wks.UPC (user parameter count) for 2022, so it can be
loop(i,1,wks.upc) {wks.userparam$(i)$=;};
CP
AKazak
Posted - 07/08/2021 : 09:08:04 AM
quote:Originally posted by cpyang
There is no difference on how they work. Loop command was introduced first to cover the most typical use of a loop and for command was added later to be like C language.
CP
OK, thank you for clarifying this.
--- Andrey
cpyang
Posted - 07/08/2021 : 06:56:35 AM There is no difference on how they work. Loop command was introduced first to cover the most typical use of a loop and for command was added later to be like C language.
CP
AKazak
Posted - 07/08/2021 : 06:19:51 AM I had another side question. https://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs provides many examples using both for and loop LT commands. What are the principal differences between for and loop commands?
--- Andrey
AKazak
Posted - 07/08/2021 : 05:51:59 AM
quote:Originally posted by cpyang
Try
loop(i,1,10){wks.userparam$(i)=;};
And to find the count, try
nn=0;loop(i,1,10) {if(wks.userparam$(i)) nn = i;};nn=;
CP
Got it! Thanks.
--- Andrey
cpyang
Posted - 07/07/2021 : 2:42:51 PM Try
loop(i,1,10){wks.userparam$(i)=;};
And to find the count, try
nn=0;loop(i,1,10) {if(wks.userparam$(i)) nn = i;};nn=;
CP
AKazak
Posted - 07/07/2021 : 12:42:09 PM I tried using the following snippet: