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
 Substitution Error: % -LabTalk expression error: 2

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
Loksley Posted - 04/05/2009 : 05:58:54 AM
Origin Ver. : OriginPro8 Sr4
Operating System: Xp Sp2

Hi everybody!

I’ve got a problem with the substitution command:
Xmin=%([%H]Sheet1, 2, 1) ;	//Store the content of row 1, column 2, Sheet1 of the active book to Xmin variable.
Xmax=%([%H]Sheet2, 2, 1) ;	//Store the content of row 1, column 2, Sheet1 of the active book to Xmax variable.
The two cells are obviously not empty (row 1, column 2, Sheet1 & 2); but when the script is executed, the first line works fine whereas the second return the following error (in the Classic Script Window):
Error: %
LabTalk expression error: 2
If these line scripts are executed from the command window, I get the following result:
385=385
% ([%H]Sheet2, 2, 1)=--
Does anyone understand what is wrong?
3   L A T E S T    R E P L I E S    (Newest First)
Loksley Posted - 04/07/2009 : 1:39:32 PM
Thanks easwar for the answer.
quote:
Just to make sure, you have the two sheets with names sheet1 and sheet2 and there are columns in there with data?
Exactly. Both sheet are filed with datas.
quote:
Does the error occur on any OPJ/book?
No, no, that's the problem, in the given example with the same Book, but two different sheets, I get both results (succed and Failed).
I've change my code
Xmax=%([%H]Sheet2, 2, 1) ;
by
page.active$=Sheet2;
Xmax=$(cell(1,2));

And it solved my problem and now I don't see this problem anymore.

easwar Posted - 04/06/2009 : 4:46:40 PM
Hi,

Could not reproduce this problem in SR4...
Just to make sure, you have the two sheets with names sheet1 and sheet2 and there are columns in there with data?

Does the error occur on any OPJ/book? If it is specific to a book/opj, please contact tech support and send the files.

Thanks,

Easwar
OriginLab
Loksley Posted - 04/05/2009 : 06:09:34 AM
As these values are then used for peak analysis script, depending of the worksheets on which I applied the script it causes some erratic crashes to my scripts.

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