SoftMaker.com

English-Language Support
It is currently Sat May 25, 2013 11:13 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 16, 2011 12:47 pm 
Offline

Joined: Mon Jan 31, 2011 9:04 pm
Posts: 38
Location: Texas
In the script snippet below, I am setting up toggles (using "not") to view or not certain things in Textmaker. All of the toggles work fine, except for View.FieldShading. I can toggle FieldShading using if/else. But I should not need an if statement. Any thoughts?

The code snippet follows:

dim tm as object
set tm = CreateObject("TextMaker.Application")

' Why won't this toggle work like the rest of the toggles below? <<<<<
'tm.ActiveWindow.View.FieldShading = not tm.ActiveWindow.View.FieldShading

' Use this workaround since the toggle line does not work
if tm.ActiveWindow.View.FieldShading = 0 then
tm.ActiveWindow.View.FieldShading = 1
else
tm.ActiveWindow.View.FieldShading = 0
end if

tm.ActiveWindow.View.HighlightComments = not tm.ActiveWindow.View.HighlightComments
tm.ActiveWindow.View.ShowBookmarks = not tm.ActiveWindow.View.ShowBookmarks
tm.ActiveWindow.View.ShowHiddenText = not tm.ActiveWindow.View.ShowHiddenText


Top
 Profile  
 
PostPosted: Wed Feb 16, 2011 12:54 pm 
Offline
SoftMaker Team
SoftMaker Team

Joined: Fri Nov 21, 2003 4:57 pm
Posts: 2087
Location: Nürnberg, Germany
"Not 0" is -1 in BASIC, but the property wants either 0 or 1.

_________________
Martin Kotulla
SoftMaker Software GmbH


Top
 Profile  
 
PostPosted: Wed Feb 16, 2011 1:21 pm 
Offline

Joined: Mon Jan 31, 2011 9:04 pm
Posts: 38
Location: Texas
Thank you for the reply. I had actually done the other three first which were boolean types. I added FieldShading as a later thought. I put it first in the snippet submitted for clarity. I assumed a boolean type for FieldShading like the others. But it is a long type. Thank you again for pointing out the obvious (if I had checked the help file again) to me.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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