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
 can't copy text from worksheet cell into variable
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

WiljanVerhees

Netherlands
7 Posts

Posted - 06/01/2018 :  05:56:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
origin 2016
%A=%([workbook]worksheet,1,1) works fine as long as the cell contains a number. If it contains text it doesn't work. Using the same commands is working when putting the text into the cell. Is there a way to fix this? Thanks a lot

wve

Hideo Fujii

USA
1582 Posts

Posted - 06/01/2018 :  09:39:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi wve,

It seems working okay in my Origin 2018b and Origin 9.1 such as:
%A=%([Book1]Sheet1,1,1);
%B=%([Book1]Sheet1,1,2);
%A=;
%B=;
1.4142135623731
ABC
Maybe you can put the trace of the performance result here?

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 06/01/2018 09:41:33 AM
Go to Top of Page

WiljanVerhees

Netherlands
7 Posts

Posted - 06/03/2018 :  03:14:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Hideo Fujii

Hi wve,

It seems working okay in my Origin 2018b and Origin 9.1 such as:
%A=%([Book1]Sheet1,1,1);
%B=%([Book1]Sheet1,1,2);
%A=;
%B=;
1.4142135623731
ABC
Maybe you can put the trace of the performance result here?

--Hideo Fujii
OriginLab



Hi Hideo,

thanks for the reply.

example code:

%([Book1]Sheet1,1,1)="text";
%([Book1]Sheet1,2,1)= 1.234;

%A=%([Book1]Sheet1,1,1);
%B=%([Book1]Sheet1,2,1);

type -a $(%A);
type -a $(%B);

getting it into the worksheet just works fine but the return is:

--
1.234

Wiljan

wve
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 06/03/2018 :  07:01:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
$(expression) is to convert a expression into number, so you are converting "text" to a number and thus a missing value is the result. Change your example into

%([Book1]Sheet1,1,1)="text";
%([Book1]Sheet1,2,1)= 1.234;

%A=%([Book1]Sheet1,1,1);
%B=%([Book1]Sheet1,2,1);

type -a "%A";
type -a "%B";


You can read more about the substitution here

https://www.originlab.com/doc/LabTalk/guide/Substitution-Notation#.24.28_.29_Substitution.24.28_.29_Substitution

CP
Go to Top of Page

WiljanVerhees

Netherlands
7 Posts

Posted - 06/03/2018 :  07:23:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

$(expression) is to convert a expression into number, so you are converting "text" to a number and thus a missing value is the result. Change your example into

%([Book1]Sheet1,1,1)="text";
%([Book1]Sheet1,2,1)= 1.234;

%A=%([Book1]Sheet1,1,1);
%B=%([Book1]Sheet1,2,1);

type -a "%A";
type -a "%B";


You can read more about the substitution here

https://www.originlab.com/doc/LabTalk/guide/Substitution-Notation#.24.28_.29_Substitution.24.28_.29_Substitution

CP


Aha...that simple...I knew it had to be something like this.
thanks a lot!!!



wve
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