|
Some examples of the problem
. . . |
|
|
A couple of examples illustrate
the way WP10/11/12/X3 (and probably future versions) will select
words if you leave the WP9TSS unchecked (i.e., OFF).
Example 1: If you use your mouse to select
a word to be underlined, you'll notice that WP10+ will also underline
the trailing space after the word, like this .
This is how many WP10 users first discovered the existence of
the new, poorly documented, and unannounced WP9TSS.
Note that underlining spaces
is primarily controlled in WordPerfect by the "Text &
Spaces" setting in Format, Font, Underline [tab]. If Text
& Spaces is enabled, you'll get underlined spaces, which
is preferred by most people -- except for trailing spaces, which
is generally not desirable.
Example 2. The following macro was posted on the
Corel WP10 newsgroup on 8/17/01. It is supposed to convert the
selected word to a word with initial capitalization. One of the
C_Techs confirmed that it works with the WP9TSS turned ON; otherwise,
it fails to work properly, and apparently converts the following
word, too!
Application (WordPerfect; "WordPerfect";
Default!; "EN") SelectWordNext () ConvertCaseInitialCaps () SelectMode
(State: Off!)
While these two examples may
seem trivial, the presence of extra spaces in some macros can
produce completely different results when the macro plays. And
you might not even notice it. (Your client or boss might, though.) |
|
|
With respect to certain cursor
movements, Charles Rossiter, a C_Tech, wrote in the Corel WP10
newsgroup:
"...Try doing Ctrl+Right
Arrow [in WP10] towards the end of a paragraph. With WP9 Text
selection [turned on to emulate WP9 and earlier versions], the
cursor jumps from word to word, even over the paragraph break.
Without WP9 text selection, at the paragraph break, the cursor
jumps to the end of the line, and then after the next hard return
and then to the start of the next paragraph....This has severe
effects on any macros which use [the] PosWordNext [command]...."
Imagine a macro, for example,
that must count words (say, by moving the cursor with the PosWordNext
command and incrementing a counter variable). Maybe the count
is meant to keep document or section size within certain limits,
or maybe it's to position the cursor at a certain spot before
other processing can occur. With the WP9TSS checked ON in WP10,
only words are counted. With it OFF (the default), it appears
from reports that it will count the end of the paragraph, the
next hard return, and then begin counting in the next paragraph.
In this imaginary example, the
OFF setting will affect the count because an accurate count depends
on how the cursor moves over a specific block of text. Paragraph
endings and hard return codes are not normally considered to
be words. |
|
In my opinion . . . |
|
There are two broad areas of concern.
The first relates to using older ("legacy") macros
in WP10 and later versions. The second relates to creating new
macros in WP10 and later versions for use in those versions. |
|
Using macros in WordPerfect 10/11/12/X3
that were written in earlier versions |
|
Any macros written in a version
prior to WP10 that are to be used in WP10/11/12/X3, and that
use the very common commands of -
PosWordNext PosWordPrevious PosParagraphNext PosParagraphPrevious |
SelectWord SelectWordNext SelectWordPrevious SelectSentence SelectSentenceNext SelectSentencePrevious SelectParagraphNext SelectParagraphPrevious
|
...and (possibly)... DeleteWord SelectOn SelectOff |
- should
have correction/compensation code added to them. This may not
be a comprehensive list: There may be other, similar commands
that should be added. (If you have found any, please contact
me.)
TIP: You can download a code-checking macro
here (WP9TSSCC.zip) that can examine
the current macro you have onscreen for editing, and create a
separate listing of any of the above commands that it finds in
the macro's code. The list can help save you some time when examining
the macro's code for proper operation under WP10+.
Here, "proper operation"
means the macro operation you personally expect with the new
"Use WP9 text selection" switch enabled (i.e., "on").
See below for the types of effects you might find with your legacy
and newly written macros.
NOTE that this is not the "compensation
code" or "code correction" macro referenced above
and elsewhere. That particular macro can be downloaded below
(as WP9TSS.zip). But please read on before you download it.
|
Here are some logical possible
results of playing a macro in WP10/11/12/X3 that was written
in a previous ("legacy") verion of WordPerfect:
|
Playing a LEGACY MACRO in WordPerfect
10/11/12/X3 |
|
... with WP9TSS "on" during
playback |
... with WP9TSS "off"
(the shipping default) |
|
The macro should play OK (WP10/11/12/X3
should act like WP9, WP8, etc.). |
The macro may have problems if the
above-mentioned commands are present, especially if the code
was written with their specific (pre-WP10) actions in mind; corrections
are highly recommended to ensure the macro plays in WP10+ the
same way it was recorded/written. |
Either of
the sample code snippets at the bottom of this page can be added
to all legacy macros as a simple precaution. Since they won't
execute in a version other than WP10 due to embedded IfPlatform()
commands, any legacy macro that has them can be used in both
the original, earlier version of WP and in WP10/11/12/X3. In
effect, the legacy macro will become "WP10/11/12/X3 aware." |
|
Using macros in WordPerfect 10/11/12/X3
that were written in WordPerfect 10/11/12/X3 |
|
Any new (WP10+) macros should
be examined to see if they are working as expected in WP10+ under
the two possible states (ON and OFF) of the WP9TSS. Obviously
the initial state of the WP9TSS when the macro was first written
or recorded can be later changed to the opposite state by any
user, thereby inadvertently modifying the macro's behavior. This
can produce unpredictable results, whether obvious or not, with
macros that contain the above commands. (And I am not certain
if any other macro commands are affected!) Here are some logical
possible results of playing a macro in WP10/11/12/X3 that was
written in a previous verion of WP or one that was written in
WP10/11/12/X3 itself:
|
Playing a NEWLY WRITTEN MACRO
in WordPerfect 10/11/12/X3 |
|
... with WP9TSS "on" during
playback, and |
... with WP9TSS "off"
(the shipping default) and |
|
... if WP9TSS was "on"
during macro's creation |
... if WP9TSS was "off"
during macro's creation |
... if WP9TSS was "on"
during macro's creation |
... if WP9TSS was "off"
during macro's creation |
|
The macro should play OK (same conditions,
same WP version). |
The macro may have problems if the
above-mentioned commands are present, especially if the code
was written with their specific actions in mind; the code should
be examined to see if corrections are required (the writer may
like the way the new text selection and cursor movement methods
work, and setting the WP9TSS to "on" may be undesirable). |
The macro may have problems if the
above-mentioned commands are present, especially if the code
was written with their specific actions in mind; corrections
are highly recommended to ensure the macro plays the same way
it was recorded/written. |
The macro either plays OK (same
conditions, same WP version) or it doesn't (e.g., if it uses
a word count routine that uses one of the above cursor-positioning
commands the count could be wrong if, say, hard returns between
paragraphs are also counted); the code should be examined to
see if correction routines are required (the writer may like
the way the new text selection and cursor movement methods work,
and no correction may be desirable). |
Such macros
are strong candidates for correction code, such as that found
below, to force them to behave as they would have behaved in
WP9 and earlier. Assuming, of course, that this was the intent
of the writer of the new WP10/11/12/X3 macros -- a very important
point to consider. (The author may want to rewrite all or part
of the macro code to make it perform predictably.)
To put it another way, if you
include these correction code snippets in a macro, you are tacitly
assuming that you want the macro to employ the legacy-standard
method of selecting words (i.e., to NOT include any following
space), moving the cursor (i.e., to NOT stop at the end of the
line, at the paragraph break, etc.), and so forth. |
|
Correction
/ compensation . . . |
|
|
The downloadable file below contains
a macro that contains code snippets that can be added to older
("legacy") macros that will be played in WordPerfect
10 (and later), to help make those macros work as they did in
the earlier version (i.e., WP9 and earlier) by temporarily enabling
this setting if it is not already enabled, then restores it to
its previous state when the macro exits.
These snippets
are also useful in newly written macros (i.e.,
written in WP10+) where you need the WP9 text selection state
turned "On" for proper macro function. Be sure to read
any comments in the macro.
Download
WP9TSS.zip (v1.01; 06/13/06;
ZIP=9,109 bytes)
See the footnote
below about a new system variable, ?WP9selection, that can also
be used. |
|
Backward compatibility in newly
written WP10/11/12/X3 macros |
|
If you include the code snippets
in the above ZIP file in a newly written WP10/11/12/X3 macro,
you are tacitly assuming that you want the macro to employ the
legacy-standard method of selecting words (i.e., to NOT include
any following space), moving the cursor (i.e., to NOT stop at
the end of the line, at the paragraph break, etc.), and so forth.
If you don't use these snippets
and you write the WP10/11/12/X3 macro by recording text selections
and cursor movements, the macro will naturally behave in the
manner dictated by the then-current "Use WP9 text selection"
setting in Tools, Settings, Environment. Later, if the user changes
this setting, the macro could produce erroneous results (whether
obvious or not).
There are several issues to confront
here:
- What happens if a user later
changes the WP9 text selection setting to the opposite of the
one used during recording (or manually coding) the macro?
- What happens if you want to
use the macro with an earlier version of WP?
- What happens if you add the
code to a WP10/11/12/X3 macro long after it was recorded or written,
and you're not sure of the original state of the WP9 text selection
setting? Unless you deliberately set the WP9 text selection ON
before recording the macro, you probably wouldn't want to blindly
add these procedures to the macro later, or you might get different
results, depending on the purpose of the macro code. Examine
the code to be sure.
Therefore, before using this
code in a new, WP10/11/12/X3 macro you should first decide the
issue of backward compatibity as well as issues of text
selection methods and cursor movement behaviors your users expect.
You may not need the code at all, or you may decide it is necessary
to make your macro perform in expected ways. The decision, like
your implemtation of the techiques here, is your responsibility. |
|
Some things worth remembering |
|
In summary: Some macros -- old or new -- played in
WP10 (and later versions that use the WP9TSS switch) will behave
differently in how they select text and move the cursor over
words, depending on the current state of the WP9TSS switch.
In particular, if pre-WP10 macros
contain the commands listed at the top of this page (PosWordNext,
SelectWord, etc.), you probably should use one or the other of
these macro code correction procedures. At the very least, such
procedures can give a consistency to macro playback, particularly
if they were written under an earlier version of WP or were written
under WP10+ with the WP9 text selection setting enabled ("on").
If they were written under WP10+ with the setting "off,"
you should carefully examine the macro's playback under both
of the setting's states, since a user could have switched this
setting and thus (possibly) affect the macro's operation. You
will want to plan for this and add whichever correction procedure(s)
seems most appropriate.
Finally, If future versions of
WP (i.e., WPX4, etc.) contain the "Use WP9 Text Selection"
setting, you probably will need to edit existing macros that
contain the above code snippets to add other IfPlatform() statement
parameters [e.g., IfPlatform (_version10!; _version11!; _version12!);_version13!;_version14!],
modify registry keys, etc. See the comments in these "code
correction" macros. |
|
Conclusion . . . |
Long-time WordPerfect users who
have upgraded to WP10 or a later version probably have discovered
that they should enable (i.e., check) the WP9TSS in the Tools,
Settings, Environment dialog. Otherwise, text selection and cursor
movement will default to the "Microsoft way."
More importantly, anyone who
uses WordPerfect macros in WP10 or later version is faced with
the issues outlined above. Simply put, do not use macros
under WP10 or later version "as is." They may
work okay, but to be certain you can open them for editing and
play the code-checking macro (WP9TSSCC.zip)
on them to create a separate list of any of the above problematic
commands that it finds in the macro's code. The list can help
save you some time when examining the macro's code for proper
operation under WP10+ and it should tell you if the macro needs
compensation code. Feel free to add the compensation code snippets
in WP9TSS.zip to any macros that contain
these problematic commands.
Note also the disclaimer here, which is particularly
appropriate for users of WP10/11/12/X3.
|
|