home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR8
/
READMCV.ZIP
/
README.MCV
Wrap
Text File
|
1993-09-13
|
34KB
|
627 lines
=================================================================
README.MCV 09/13/93
=================================================================
The following information is included:
*Introduction
*Error Messages
*Conversion Warnings
INTRODUCTION
=================================================================
This README file contains information about MCV.EXE, the Macro Conversion
Program that converts macros from WordPerfect 5.1 for DOS to WordPerfect 6.0
for DOS. The Macro Conversion Program can convert one or more macros. Once
converted, the macro(s) can be retrieved (Shift+F10) into WordPerfect 6.0 as
a normal document. Since WordPerfect 6.0 macros are essentially normal
documents, commands are simply words typed in the document. This allows the
user to use all of the powerful WordPerfect editing tools when writing
macros. When the macro is saved or played, WordPerfect automatically
"compiles" the macro into a language WordPerfect can understand. This
compilation process causes no visual changes to the macro or macro commands.
The Macro Conversion Program will mark problems and warnings in the resulting
macro as comments, so you'll know exactly where there was a problem or
concern. If debugging help is needed, WordPerfect has an improved debugger
to help you step through macro execution watching for problems.
When conversion problems or warnings occur, it is recommended that modifying
the original WordPerfect 5.1 macro and reconverting it may be the easiest way
to get the converted macro up and running.
If you are familiar with the WordPerfect 5.1 macro language, adjusting to the
WordPerfect 6.0 macro language may be made easier by writing a new macro
first in WordPerfect 5.1, converting it, and noticing how the Macro
Conversion Program converted the macro.
=================================================================
ERROR MESSAGES
=================================================================
This section of this file documents some error messages that may be placed in
the converted WordPerfect 6.0 macro document.
Label already referenced with different keystrokes
=================================================================
This error occurs when a label that was initially referenced while
WordPerfect was in one state (for example, while Block is turned on) is
subsequently referenced while WordPerfect is in another state. The Macro
Conversion program flags this as a problem because the tokens that the Macro
Conversion Program creates are sometimes dependant on what state or mode
WordPerfect is in at the time. Below is an example of a converted macro with
this problem. (The numbers at the beginning of each line are for reference
purposes only.)
Example 1:
Original WordPerfect 5.1 macro Converted WordPerfect 6.0 macro
============================== ===============================
{CALL}move~ 1 CALL(move)
{Word Left} 2 PosWordPrevious
{Block}{End} 3 BlockOn(CharMode!) PosLineEnd
{CALL}move~ 4 CALL(move
{Page Down} 5 //*** Conversion problem ***
{CALL}move~ 6 //*** Label already referenced with
{GO}format~ 7 //different keystrokes
{LABEL}move~ 8 //{Block}{End}
{Move}12 9 )
{Switch} 10 PosPageNext
{Home}{Home}{Down} 11 CALL(move
{Enter} 12 //*** Conversion problem ***
{Home}{Home}{Down} 13 //*** Label already referenced with
{Enter} 14 different keystrokes
{Switch} 15 //{Block}{End}{Page Down}
{RETURN} 16 )
{LABEL}format~ 17 GO(format)
18 LABEL(move
19 //*** Conversion problem ***
20 //*** Ambiguous keystrokes leading
21 to label
22 )
23 BlockOn(SentenceMode!) CopyAndPaste
24 Switch
25 PosDocBottom
26 MoveModeEnd
27 PosDocBottom
28 EnterKey
29 Switch
30 RETURN
31 LABEL(format)
In the example above, the MOVE label is first referenced on line one. Notice
that on line three the Block feature is turned on, and then on line four, the
MOVE label is again referenced. The Macro Conversion Program remembers what
state WordPerfect was in when the MOVE label was first referenced on line
one. Since WordPerfect will be in a different state (BlockOn) when the MOVE
label is referenced on line four, the Macro Conversion Program generates the
error "Label already referenced with different keystrokes." On line eight
the Macro Conversion Program displays the WordPerfect 5.1 commands (i.e.,
{Block}{End}) that triggered the error. Once this error has occurred, any
subsequent references to that label (including references made in the same
state as the first reference) will generate the error as can be seen by
referring to line 11 where LABEL(move) has been referenced a third time. To
see why there is a problem, refer to line 23 and notice that the Macro
Conversion Program has converted "{Move}12" to "BlockOn(SentenceMode!)
CopyAndPaste" which are the proper tokens when this label was first
referenced in line one. However, when LABEL(move) is referenced the second
time with block on, the BlockOn(SentenceMode!) would be an unnecessary token
and would generate an error if the macro were played. Consequently, the
Macro Conversion Program has generated an additional error on line 20,
"Ambiguous keystrokes leading to label," because LABEL(move) has been
referenced while WordPerfect was in different states; and although the tokens
created are correct for the first reference, they are likely to be incorrect
for the reference made when WordPerfect was in a different state.
There are also instances where the Macro Conversion Program will generate
this error, yet the macro will execute properly. Below is an example of such
a case.
Example 2:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{CALL}search~ 1 CALL(search)
WordPerfect 2 Type("WordPerfect")
{Page Down} 3 PosPageNext
{Block} 4 BlockOn(CharMode!)
{CALL}search~ 5 CALL(search
{Word Left} 6 //*** Conversion problem ***
{Macro Commands} 7 //*** Label already referenced with
3client{Enter} 8 different keystrokes
{GO}add~ 9 //{Block}
{LABEL}search~ 10 )
{Search}Company:· 11 PosWordPrevious
{Search} 12 ASSIGN(client; ?BlockedText)
{RETURN} 13 GO(add)
{LABEL}add~ 14 LABEL(search
15 //*** Conversion problem ***
16 //*** Ambiguous keystrokes leading
17 to label
18 )
19 SearchString("Company: ")
20 SearchNext(Regular!)
21 RETURN
22 LABEL(add)
In this particular case, the tokens SearchString("Company: ")
SearchNext(Regular!) on lines 19 and 20 are correct whether Block is turned
on or off. Consequently, this macro will execute properly and the conversion
problems can be ignored. Why does the Macro Conversion Program still
generate an error if the macro will run properly? The Macro Conversion
Program converts macros from top to bottom in a single pass. Consequently,
the keystrokes in the referenced label are not encountered until it has
already passed and converted the references to it. The Macro Conversion
Program only knows that the state or mode of WordPerfect for the second
reference to the label is different from the state when the label was first
referenced, and that there may be a problem.
If there are no other problems that would keep the macro from compiling or
executing properly, first try ignoring the errors and play the macro to see
if it will run correctly. If that fails, edit the WordPerfect 5.1 macro and
insert the actual keystrokes of the label referenced. If that label is
referenced often in different states, it may be easier to create a duplicate
label, give it a different name, and reference it when in a different state.
For example, the WordPerfect 5.1 macro in Example 1 could be changed as
follows:
Original WordPerfect Approach A: Approach B:
5.1 macro
===================== =========== ===========
{CALL}move~ {CALL}move~ {CALL}move~
{Word Left} {Word Left} {Word Left}
{Block}{End} {Block}{End} {Block}{End}
{CALL}move~ {Move}12 {CALL}moveblock~
{Page Down} {Switch} {Page Down}
{CALL}move~ {Home}{Home}{Down} {CALL}move~
{GO}format~ {Enter} {GO}format~
{LABEL}move~ {Home}{Home}{Down} {LABEL}move~
{Move}12 {Enter} {Move}12
{Switch} {Switch} {Switch}
{Home}{Home}{Down} {Page Down} {Home}{Home}{Down}
{Enter} {CALL}move~ {Enter}
{Home}{Home}{Down} {GO}format~ {Home}{Home}{Down}
{Enter} {LABEL}move~ {Enter}
{Switch} {Move}12 {Switch}
{RETURN} {Switch} {RETURN}
{LABEL}format~ {Home}{Home}{Down} {LABEL}moveblock~
{Enter} {Move}12
{Home}{Home}{Down} {Switch}
{Enter} {Home}{Home}{Down}
{Switch} {Enter}
{RETURN} {Home}{Home}{Down}
{LABEL}format~ {Enter}
{Switch}
{RETURN}
{LABEL}format~
If LABEL move is referenced only once with Block turned on, then approach A
or B could be used to solve the problem. If LABEL move is referenced often
with Block on, then approach B would be the most efficient way to solve the
problem.
Ambiguous keystrokes leading to label
==================================================================
This error is related to the "Label already referenced with different
keystrokes" error message and occurs in the actual label that is being
referenced by routines in different states or modes. Making the changes to
solve the "Label already referenced with different keystrokes" error message
will also solve this problem.
Control transfer with pending token
==================================================================
The Macro Conversion Program makes one pass from top to bottom when
converting macros. Consequently, when converting a series of keystrokes to
the proper token, the Macro Conversion Program cannot "jump" to another
routine to convert the rest of the keystrokes needed to complete that token.
For example, if a {GO} or {CALL} is encountered while a token is yet to be
completed, that token cannot be completed and this error will be generated.
Example 3:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
================================ ==================================
{Retrieve} 1
{CALL}filename~{Enter} 2 CALL(filename) Paste
{GO}address~ 3 GO(address)
{LABEL}filename~ 4 LABEL(filename)
letter.doc 5 RETURN
{RETURN} 6 //*** Conversion problem***
{LABEL}address~ 7 //*** Control transfer with
8 pending token
9 //{Retrieve}letter.doc
10 LABEL(address)
This error will also occur if a WHILE, FOR, or IF statement occurs in the
middle of creating a token. In the example below, an IF statement occurs in
the middle of creating a line spacing token.
Example 4:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{TEXT}1~ 1 GETSTRING(VAR1;
Please·enter·your·name:··~ 2 "Please enter your name: ")
{Format}16 3 IF(VAR1="") DISCARD(VAR1)
{IF}"{VAR 1}"="John"~ 4 ENDIF
2 5 IF(""+VAR1+""="John")
{ELSE} 6 ELSE
1.5 7 //*** Conversion problem ***
{END IF} 8 //*** Control transfer with
{Enter} 9 // pending token
{Exit} 10 //{Format}162
11 ENDIF
12 LineSpacing(1.5)
In the WordPerfect 5.1 macro, replace the {GO} or {CALL} with the keystrokes
of the label that is referenced. If the problem is caused by a WHILE, FOR,
or IF statement, restructure the routine so the statement is not within the
series of keystrokes that would need to be converted to a token. For example,
the WordPerfect 5.1 version of the macro above (Example 4) could be changed
as follows:
Original WordPerfect 5.1 macro WordPerfect 5.1 macro after change
============================== ==================================
{Format}16 {IF}"{VAR 1}"="John"~
{IF}"{VAR 1}"="John"~ {ASSIGN}line~2~
2 {ELSE}
{ELSE} {ASSIGN}line~1.5~
1.5 {END IF}
{END IF} {Format}16
{Enter} {VARIABLE}line~
{Exit} {Enter}
{Exit}
After making the changes to the WordPerfect 5.1 macro, reconvert it using the
Macro Conversion Program.
Pending tokens leading to label
==================================================================
This error is related to "Control transfer with pending token" errors
generated by {GO} or {CALL} commands. This error occurs when part of the
arguments (for the token being created) are found in another label being
referenced by the {GO} or {CALL}. The error will appear in the label being
referenced by that {GO} or {CALL}.
Example 5:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{Columns/Tables}21 1
5{Enter} 2
{CALL}rows~{Enter} 3 CALL(rows
{Exit} 4 //*** Conversion problem***
{QUIT} 5 //*** Control transfer with
{LABEL}rows~ 6 //pending token
5 7 //{Columns/Tables}2
{RETURN} 8 15{Enter}
9 ) TableCreate(5;
10 //*** Conversion warning***
11 0)
12 QUIT
13 LABEL(rows
14 //***Conversion problem***
15 //*** Pending tokens
16 //leading to label
17 )
18 RETURN
Notice that in line three in the WordPerfect 5.1 macro, the number of rows
for the table being created (which would be one of the arguments that the
Macro Conversion Program would need to create the proper token) is located
after {LABEL}rows~ on line 13. This situation will cause a "Control transfer
with pending token" error and the Macro Conversion Program will then generate
a corresponding error "Pending tokens leading to label" at {LABEL}rows~,
showing that this LABEL was referenced when arguments for a token were not
complete.
Making the changes to solve the "Control transfer with pending token" error
message will also fix this problem.
Cannot generate matching 6.0 Search text
==================================================================
This error occurs when the Macro Conversion Program is unable to create the
equivalent search text or code for WordPerfect 6.0. The reasons for this can
vary from the character not existing in WordPerfect 6.0 (see line five in
Example 6 below) to having a conditional statement such as an IF within the
beginning and ending search commands (see line 16 in Example 6 below).
Example 6:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ===================================
{Search} 1 //*** Conversion problem ***
{^A} 2 //*** Cannot generate matching 6.0
{Search} 3 //Search text
{Block}{Word Right} 4 //{Search}
{Macro Commands} 5 //{^A}
31{Enter} 6 SearchString("") SearchNext(Regular!)
{TEXT}3~Please·enter·your·last· 7 BlockOn(CharMode!) PosWordNext
name:··~
{Search} 8 ASSIGN(VAR1; ?BlockedText)
{IF}"{VAR3}" 9 GETSTRING(VAR3; "Please enter your
="Smith"~Smith 10 last name: ")
{ELSE}Contractor 11 IF(VAR3="") DISCARD(VAR3) ENDIF
{END IF} 12 //*** Conversion problem ***
{Search} 13 //*** Cannot generate matching
{Enter}{VAR 1} 14 //6.0 Search text
15 //{Search}
16 //{IF}"{VAR 3}"
17 //="Smith"~Smith
18 //{ELSE}C
19 //*** Limit exceeded for commands
20 //skipped
21 Type("ntractor") ENDIF
22 //*** Conversion problem ***
23 //*** Not at main document at end
24 //of macro
25 //*** Cannot convert to matching
26 //dialog
27 //{Search}{Enter}{VAR 1}
When the Macro Conversion Program generates this error, it will not convert
any commands until it encounters the ending {Search} code. The commands not
converted or "skipped" will be commented out (using the "//" characters) as
can be seen by referring to lines 15-18. However, there is a limit to the
number of commands that will be skipped. When this limit is reached, the
Macro Conversion Program will generate a second message "Limit exceeded for
commands skipped" (See line 19) and will begin converting again (See line
21). Usually this will cause other errors to follow.
Frequently, this error is caused when previous errors cause the Macro
Conversion Program to get out of "sync." It may be best to fix other
problems first, reconvert and see if this error is also eliminated. If not,
check to see if the problem is caused by an IF or a similar statement between
the beginning and ending {Search} commands. If this is the case, then edit
the WordPerfect 5.1 macro and restructure the statement so it does not occur
within the {Search} commands, then reconvert the file. For example, the
search statement in Example 6 above could be changed as follows:
Original After changes
======== =============
{Search} {IF}"{VAR 3}" ="Smith"~
{IF}"{VAR 3}" ="Smith"~ {ASSIGN}4~Smith~
Smith {ELSE}
{ELSE} {ASSIGN}4~Contractor~
Contractor {END IF}
{END IF} {Search}{VAR 4}{Search}
{Search}
Limit exceeded for commands skipped
==================================================================
See explanation for "Cannot generate matching 6.0 Search text" above.
Fragmented text input
==================================================================
This error will occur when conditional statements such as an {IF} or control
flow statements using {CALL} or {GO} commands occur within a save routine.
Example 7:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{Save}test 1
{IF}{VAR 1}=1~ 2 IF(VAR1=1)
.doc{Enter} 3 //*** Conversion problem ***
{ELSE} 5 //*** Control transfer with
.txt{Enter} 6 //pending token
{END IF} 7 //{Save}test
8 //*** Conversion problem ***
9 //*** Fragmented text input
10 FileSave(".doc")
11 ELSE
12 //*** Conversion problem ***
13 //*** Fragmented text input
14 FileSave(".txt")
15 ENDIF
To resolve this error message, edit the WordPerfect 5.1 macro and restructure
the routine so the input for the save is not fragmented. For example, the
problem in Example 7 above could be eliminated by editing the WordPerfect 5.1
macro, deleting the word test after {Save} on line one and then typing "test"
in front of ".doc" on line 10 and again on line 14 before ".txt". Although
in most cases it will be easier for you to make the necessary changes to the
WordPerfect 5.1 macro and then reconvert, the macro above illustrates a
situation where editing the converted macro would be quicker and easier.
Note that by typing the word test before .doc on line 10 and before .txt on
line 14 of the converted macro will also solve the problem.
Not at main document at end of macro
=================================================================
Cannot convert to matching dialog
=================================================================
If a macro ends and leaves the user in another location other than the main
document screen, the Macro Conversion Program will attempt to convert the
keystrokes to the corresponding WordPerfect 6.0 dialog command. If there is
no matching WordPerfect 6.0 dialog command for the keystrokes that are
encountered at the end of the macro, these error messages will be generated.
Example 8:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{List}c:\wp60{Enter} 1 //*** Conversion problem ***
2 //*** Not at main document at end of
3 //macro
4 //*** Cannot convert to matching
5 //dialog
6 //{List}c:\wp60{Enter}
In Example 8 above, the WordPerfect 5.1 macro leaves the user in the List
Files screen. A FileManagerDlg dialog command does exist in WordPerfect 6.0,
but this would not leave the user in the List Files screen; consequently, the
Macro Conversion Program has flagged this as a problem.
To resolve this error message, first verify that the WordPerfect 5.1 macro
does indeed end in a screen other than the main editing screen. Sometimes
previous conversion problems can cause this error to occur. Since there is
no matching dialog in WordPerfect 6.0, there is little the user can do
without some knowledge of the WordPerfect 6.0 macro language. In the example
above, the user could edit the WordPerfect 5.1 macro so it ended with only
the command {List}, which the Macro Conversion Program could convert to the
FileManagerDlg command. But as was mentioned before, this would not leave
the user in the List Files screen. To get a converted macro with this
problem to end exactly as it did in WordPerfect 5.1, the user would need to
become familiar with the DLGINPUT command and the appropriate dialog command
in 6.0. For example, to get the converted macro above to end in the List
Files screen as it did in 5.1, the following tokens would need to be inserted
at the end of the converted macro:
DLGINPUT(On!)
FileManagerDlg
TYPE("c:\wp60")
Enterkey
DLGINPUT(Off!)
Name Missing
==================================================================
This error message is generated when a macro selects an item from a list, but
does not do a name search. The Macro Conversion Program is unable to
generate a token, since it does not know what item the cursor was
highlighting.
Example 9:
Original WordPerfect 5.1 macro Macro converted to WordPerfect 6.0
============================== ==================================
{Font}4{Enter}12{Enter} SAVESTATE PERSISTALL
AutoCodePlacement(OFF!)
WP51CursorMovement(ON!)
VARERRCHK(OFF!)
//*** Conversion problem ***
//*** Name missing
//{Font}4{Enter}
FontSize(12)
Notice the macro presses the font key (Ctrl-F8), 4, then presses ENTER to
select the currently highlighted font.
The Macro Conversion Program did not have enough information to generate a
FONT("font name") token. The WordPerfect 5.1 macro just selected the default
font. In WordPerfect 6.0 it is impossible to have a token of FONT(default).
A specific value needs to be specified, for example, FONT("Times Roman").
Following is an example WordPerfect 5.1 macro that does not cause the error:
Original WordPerfect 5.1 macro Macro converted to WordPerfect 6.0
============================== ==================================
{Font}4nTimes Roman SAVESTATE PERSISTALL
{Enter}{Enter}12{Enter} AutoCodePlacement(OFF!)
WP51CursorMovement(ON!)
VARERRCHK(OFF!)
Font("Times Roman")
FontSize(12)
The Macro Conversion Program read the keystrokes during the name search to
know what font to be included in generating the FONT("Times Roman") token.
==================================================================
Conversion Warnings
==================================================================
Warning: Some characters skipped
==================================================================
This warning occurs when a label or variable name contains characters that
are invalid in the WordPerfect 6.0 macro language. The exception to this is
a space that is converted to an underscore character. When the Macro
Conversion Program encounters invalid characters, they are skipped or
omitted. For example, if there was a {LABEL}file+name~ statement in the
WordPerfect 5.1 macro, it would be converted to LABEL(filename) and then
generate this warning.
The macro will need editing if there are label or variable names whose
uniqueness is determined by invalid characters. For example, if there were
two labels in the WordPerfect 5.1 macro called file+name and file-name, both
would be converted to filename and a compilation error would occur if the
macro were played. Instances where variable names are converted to the same
name would usually not generate a compilation error, so it would be important
to check for duplicate variable names where this error has occurred. If
there are no problems with duplicate label or variable names, then the
warning can be ignored.
May edit incorrect line
==================================================================
The Macro Conversion Program generates this warning due to graphic line
editing differences between WordPerfect 5.1 and WordPerfect 6.0. When
editing a graphic line in WordPerfect 5.1, the type of line, vertical or
horizontal would be indicated after positioning the cursor in the correct
location. In WordPerfect 6.0, no distinction is made between vertical and
horizontal as far as indicating the line to be edited. Instead, the line
number, the next line, or the previous line is indicated. Since the Macro
Conversion Program cannot indicate a line number, a GraphicsLineEditNext
token will be created to indicate the line to be edited. This may be a
problem depending on cursor position and if there are both vertical lines and
horizontal lines in the document.
Example 10:
Original WordPerfect 5.1 Macro Macro converted to WordPerfect 6.0
============================== ==================================
{Graphics}53 1 //*** Conversion warning ***
154{Enter} 2 //*** May edit incorrect line
{Enter} 3 GraphicsLineEditNext
{Down}{Down} 4 GraphicsLineType(Horizontal!)
{Down}{Down} 5 GraphicsLineHorizontalPosition(Set!;4)
{Graphics}53 6 GraphicsLineEnd(Save!)
12 7 PosLineDown PosLineDown
{Enter} 8 PosLineDown PosLineDown
9 //*** Conversion warning ***
10 //*** May edit incorrect line
11 GraphicsLineEditNext
12 GraphicsLineType(Horizontal!)
13 GraphicsLineHorizontalPosition(Right!)
14 GraphicsLineEnd(Save!)
The macro above edits two horizontal graphic lines. If the cursor was
initially positioned in front of the first horizontal line code, then the
macro would edit the correct lines. However, if the cursor was positioned
after the first horizontal line code or if there was a vertical line code
preceding the first horizontal line code, then the macro would edit the wrong
lines. To resolve the error message, play the macro and see if the correct
lines are edited. If not, turn on Reveal Codes in the document that the
macro will be editing, note the line numbers of the lines to be edited, and
replace the GraphicsLineEditNext token in the WordPerfect 6.0 macro with a
GraphicsLineEdit token and indicate the appropriate line number as the
argument for that token. For example, suppose in example 9 above that the
line numbers of the horizontal lines that the macro should edit are 2 and 5.
The GraphicsLineEditNext tokens on lines 3 and 11 would need to be changed to
GraphicsLineEdit(2) and GraphicsLineEdit(5) respectively.