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
 Forum for Origin C
 end of range in origin c

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
elirosen Posted - 05/12/2006 : 10:30:21 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: win xp

i'd like to know how to use Origin C to evaluate the number of rows in a column that have data. In LabTalk I can use the get -e command to this effect, but I haven't been able to figure out how to do it in Origin C.

I'd really love to know:
1. the origin c command
2. how to assign a LT command to a C variable. I've tried to use
LT_execute("get %(%H,"+ii+")) -e nRows", &nRows); but it hasn't seemed to work.

Many thanks for the help, and also for the invaluable forum.

-Eli
2   L A T E S T    R E P L I E S    (Newest First)
elirosen Posted - 05/12/2006 : 1:33:50 PM
Thank you, Mike. This is really helpful.

Edited by - elirosen on 05/12/2006 1:34:35 PM
Mike Buess Posted - 05/12/2006 : 11:45:29 AM
Hi Eli,

1. Use Column::GetUpperBound.
2. You need two commands: LT_execute and LT_get_var.

Following code demonstrates both points. (Takes an OriginC column index as argument.)

void test(int colIndex = 0)
{
Worksheet wks = Project.ActiveLayer();
out_int("lastrow=",wks.Columns(colIndex).GetUpperBound());

colIndex++; // convert to LabTalk index
LT_execute("get %(%H," + colIndex + ") -e nrows");
double nrows;
LT_get_var("nrows",&nrows);
out_int("nrows=",(int) nrows);
}

Mike Buess
Origin WebRing Member

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