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
 MAX() and line number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gstiago

Brazil
9 Posts

Posted - 04/27/2016 :  8:57:51 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

SeanMao

China
288 Posts

Posted - 04/27/2016 :  11:21:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

gstiago

Brazil
9 Posts

Posted - 04/28/2016 :  08:29:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Sean,

It worked perfectly.

Very nice!

tnks.

best Regards

T. G. Santos
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