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
 double quotes vs single quotes

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
asenv Posted - 06/12/2010 : 07:19:23 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.1G SR1
Operating System: win 2000 pro

I have a question about quotes. If I execute the next script
win -t p testplot testplot;
win -T d 123 Data1;
win -t m Testmatrix1 Testmatrix1;

doc -e O
{
if (%H=="Data1")
{type "%H exists"}
}

I get: Data1 exists
If I replace Data1 with Testmatrix1 I get nothing. Assuming the windows are there execute only this:
doc -e O
{
if (%H=="Testmatrix1")
{type "%H exists"}
}

If I replace the double quotes with single ones '' the I get: Testmatrix1 exists
doc -e O
{
if (%H=='Testmatrix1')
{type "%H exists"}
}


So why the double quotes work with all windows except the matrix book? Should I use in this case generally single quotes? In all examples in the labtalk manual are used double quotes:

%M = test;
if (%M == "TEST") type -b "Yes!";
2   L A T E S T    R E P L I E S    (Newest First)
asenv Posted - 06/13/2010 : 11:47:31 AM
Again, thanks for your fast reply Penn. I will use your way.

Cheers
Asen
Penn Posted - 06/13/2010 : 03:04:57 AM
Hi,

It is invalid to use single quotes for string. Maybe you can try the way like the following script.

win -t p testplot testplot;
win -T d 123 Data1;
win -t m Testmatrix1 Testmatrix1;

doc -e O
{
string str$ = %H;
if (str$=="Testmatrix1")
{type "%H exists"}
}


Penn

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