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
 MAX() and line number

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
gstiago Posted - 04/27/2016 : 8:57:51 PM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.5
Operating System: WIN 7 32 bits


Hello Everyone,

I need help with script Im working..
I have many sheets in a workbook, and I want take a max value for a specific column I just made that:

loop(ii,1,page.nlayers)
{
page.active=$(ii);
dd = Max(col(16));
[book1]30!cell($(ii),30) = dd;
}

Its works, but now I want know whats the line index for every MAX value I find.

I tray somethings like that:

vfind ix:= 16 v:=max(col(16)) ox:=[book1]30!cell($(ii),29) (inside of the loop)

but I get ox: error,

How the better way to send multi index ( ox:= ) for same the column.

Can someone help me please.


My Best Regards.

Tiago.








T. G. Santos
2   L A T E S T    R E P L I E S    (Newest First)
gstiago Posted - 04/28/2016 : 08:29:31 AM
Dear Sean,

It worked perfectly.

Very nice!

tnks.

best Regards

T. G. Santos
SeanMao Posted - 04/27/2016 : 11:21:06 PM
Hi,

The output of vfind should be in vector form, therefore you need to define a dataset to temporarily save it and use the value from that dataset:


loop(ii,1,page.nlayers)
{ 
page.active=$(ii); 
dd = Max(col(2));
[book1]4!cell($(ii),1) = dd;
dataset ds1;
vfind ix:= 2 v:=dd ox:=ds1;
[book1]4!cell($(ii),2) = ds1[1];
}



Give this a try and see how it goes!

Regards!

Sean

OriginLab Tech.

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