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
 double quotes vs single quotes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

asenv

35 Posts

Posted - 06/12/2010 :  07:19:23 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!";

Penn

China
644 Posts

Posted - 06/13/2010 :  03:04:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

asenv

35 Posts

Posted - 06/13/2010 :  11:47:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Again, thanks for your fast reply Penn. I will use your way.

Cheers
Asen
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