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
 Substitution Error: % -LabTalk expression error: 2
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Loksley

France
18 Posts

Posted - 04/05/2009 :  05:58:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. : OriginPro8 Sr4
Operating System: Xp Sp2

Hi everybody!

Ive 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?

Loksley

France
18 Posts

Posted - 04/05/2009 :  06:09:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

easwar

USA
1965 Posts

Posted - 04/06/2009 :  4:46:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Loksley

France
18 Posts

Posted - 04/07/2009 :  1:39:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.


Edited by - Loksley on 04/07/2009 1:40:36 PM
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