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
 Can not get mark to work

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
kemcelroy Posted - 12/02/2003 : 8:18:17 PM
I would like to mask datapoints from within my C code. Here is what I have written:

LT_set_var("c1",i+3); //1
LT_set_var("r1",j+1); //2
LT_set_var("c2",i+3); //3
LT_set_var("r2",j+1); //4
LT_execute("worksheet -s c1 r1 c2 r2"); //5
LT_execute("mark -w1 S2_A"); //6

I have tried troubleshooting with this code:

if(<a statement from above>)
printf("success");

and all but line 6 read out "success". I have typed the strings from line 5 and 6 into the Worksheet Script window and they worked fine (substituting the correct values for c1, r1, c2, and r2).

Does anyone know a fix for this?
3   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 12/03/2003 : 5:15:40 PM
You can also do this...

Worksheet wks("S2");
wks.LT_execute("worksheet -s c1 r1 c2 r2");

or

LT_execute("win -o S2 {worksheet -s c1 r1 c2 r2}");

The LabTalk win -o command activates the named worksheet only for the purpose of running the bracketed script. The worksheet is never actually brought to the front. wks.LT_execute() does the same thing.

Mike Buess
Origin WebRing Member
kemcelroy Posted - 12/03/2003 : 1:31:32 PM
Thank you. I activated the S2 worksheet with this code:

LT_execute("window -a S2");

and now the rest of the code works.
Mike Buess Posted - 12/03/2003 : 12:19:05 AM
Your code works fine for me in Origin 7 SR4. Are you taking into account the fact that indices are 0 based in Origin C and 1 based in LabTalk?

void test(int i, int j)
{
LT_set_var("c1",i+3);
LT_set_var("r1",j+1);
LT_set_var("c2",i+3);
LT_set_var("r2",j+1);
LT_execute("worksheet -s c1 r1 c2 r2");
LT_execute("mark -w1 %H_A");
}

test 0 0; // masks cell at row 1, col 3 in active worksheet

...One possible reason that your code doesn't work is that the wks S2 isn't active when the "worksheet -s" command executes.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 12/03/2003 12:20:16 AM

Edited by - Mike Buess on 12/03/2003 12:33:31 AM

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