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
 can't copy text from worksheet cell into variable

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
WiljanVerhees Posted - 06/01/2018 : 05:56:03 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
WiljanVerhees Posted - 06/03/2018 : 07:23:15 AM
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
cpyang Posted - 06/03/2018 : 07:01:27 AM
$(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
WiljanVerhees Posted - 06/03/2018 : 03:14:35 AM
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
Hideo Fujii Posted - 06/01/2018 : 09:39:58 AM
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

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