Reply to topic  [ 3 posts ] 
active doc question 
Author Message

Joined: 2007-04-12 14:59:36
Posts: 229
I have an open document called "MYDOC". I would like to test whether it is active and if not make it active. I wrote

Code:
$doc = Document.active
if $doc = "MYDOC"
   prompt "$doc is active"
else
   Document.setActive $doc
end


What's wrong with this? The macro doesn't complain. But whether MYDOC is actually active or not, I always get the answer that it is.


2014-05-03 06:53:40
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
Two problems:
  1. "=" is an assignment, "==" is a comparison
  2. $doc is an object
Try
Code:
if $doc.name == "MYDOC"

_________________
philip


2014-05-03 15:36:39
Profile

Joined: 2007-04-12 14:59:36
Posts: 229
Glad to have you helping. Thank You.


2014-05-04 06:23:28
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software