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
 Question about script.

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
SvenP Posted - 09/17/2009 : 06:41:47 AM
Origin Ver. 7.5 and Service Release 6
Operating System: WinXP

Hello.

Here

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Flow_of_Control#If.2C_If-Else

at the If-section is an example script. "The next script finds the first point in column A that is greater than 100."
But how is that working. As I understand. Origin is looking in Col(A)[1] if the value is greater than 100. If not ii becomes 2 and the script stops.

I need a script which gives me the point of a column where a specific value is stored.
For example: "data1_data(-2,2,0.01);" Where is for instance -1.95?

I tried with for and if and also with loop an if, but it is not working.

p=0;
loop (l,1,401)
{
if (data1_a[l]=-1.95) p=l;
};
p=;

Thanks
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 10/12/2009 : 09:51:32 AM
You can use the colnum function in conjunction with the wcol function to get a column index from its name as in:

for(n = 1 ; n <= 10 ; n++)
{
wcol(colnum(A$(n)))[1] = n;
}
SvenP Posted - 10/05/2009 : 09:22:06 AM
Thank you for your reply.

Now I have another simple question.
How can I access in a for-loop to columns named e.g. A1...A10.
For example that one is of course not working.

for (n=1;n<=10,n++){
data_a"n"[1]=1;
};

In this example in the first row of column A1 to A10 should be a 1.

Thanks
greg Posted - 09/17/2009 : 4:14:54 PM
Thank you for pointing out the bad script. Please check again for the updated version.

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:Flow_of_Control#If.2C_If-Else

Note that there is a problem with your script :
if (data1_a[l]=-1.95) p=l;
which should read :
if (data1_a[l]==-1.95) p=l;

Also, to take advantage of the break command to short circuit the loop, you should use :

loop (l,1,401)
{
if (data1_a[l] == -1.95) break;
}
l=;

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