Microsoft KB Archive/23113

Function of “Magic:” Field in PCSDs of PRDs

PSS ID Number: Q23113 Article last modified on 11-02-1994

1.x 2.x 3.x

MS-DOS

Question:

What does the “magic:” field of the PCSDs in the PRDs mean?

Response:

The “magic” value (if any) is added to the parameter after Word calculates the parameter, and before Word sends the parameter to the printer. There are two cases where a non-zero magic would be needed:


 * 1) The printer requires a “non-zero” parameter for the associated control sequence (i.e., the printer cannot understand a parameter of zero for its line spacing control sequence). Since the minimum parameter that Word might calculate to send is 0 for all PCSDs, the “magic” for that byte should be 1. Then, if Word calculates 0 as the parameter, Word will add the “magic” and actually send a 1 to the printer, and the printer will not malfunction.
 * 2) The printer subtracts from the parameter it receives. In this case the “magic” should be the amount that the printer subtracts from the parameter. For example, if the printer manual gives the “set line spacing” sequence as ESC US (n-1), this tells you that if the printer receives “n” as the parameter, the printer will actually set the line spacing to “n-1”. However, there is no way for Word to know when it is calculating the parameter that the printer is going to subtract from it. If at byte:18, though, the “magic” is set to 1, then Word will add 1 to the parameter just before sending it, thus making up for the fact that the printer is going to subtract 1 after the printer receives it.

A “non-zero magic” is rarely needed. Again, it is only needed if, for a control sequence, the printer documentation indicates the following:


 * 1) The parameter cannot be zero.
 * 2) An amount is subtracted from the parameter.

KBCategory: kbother KBSubcategory: Additional reference words:

=
================================================================ Copyright Microsoft Corporation 1994.