rfdspec.gml

来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 652 行 · 第 1/2 页

GML
652
字号
:H2.Device Functions
:INCLUDE file='rfdindd'.
:I1.device functions
:P.
When creating a device or driver definition,
it may be necessary to enter non-printable characters
or information which will not be available until the
document is processed.
Arithmetic operations may also have to be performed on the
data while the document is being processed.
Device functions allow you to specify this information
in the device or driver definitions.
:P.
Most of the device functions operate on supplied parameter values
and return
either a :HP2.numeric:eHP2. or :HP2.character:eHP2. result.
:P.
A :HP2.numeric:eHP2.
:I2 refid='devfunc'.numeric result
value is a sequence of
digits, or the result of a device function which returns a number.
Numeric values may be in either decimal or hexadecimal form.
Hexadecimal numeric values begin with a dollar($) sign and are composed
of digits and the characters :HP2.A:eHP2. through :HP2.F:eHP2..
:P.
A :HP2.character:eHP2.
:I2 refid='devfunc'.character result
value is a sequence of characters
enclosed in either single(') or double(") quotation marks.
The quotation marks surrounding the text are not part of the character
value.
If a quotation mark of the same type used to delimit the character
value is to be part of the character text, it may be entered
by specifying the quote character twice.
Only one quote character will appear in the resulting character value.
This should only be done when the quote character you wish to enter
as part of the character text is the same quote character being used to
delimit the character value.
The following lines illustrate valid character values:
:XMP.
'hello 12'
"hello 12"
"he'llo 12"
"he""llo 12"
:eXMP.
:PC.
The following lines illustrate invalid character values:
:XMP.
hello 12
hello 12"
"he"llo 12"
:eXMP.
:PC.
The following line is a valid character value, but is probably
not the correct  specification.
:XMP.
"it''s 12"
:eXMP.
:PC.
The two single quotes will be part of the character value
because double quotes are used to enclose the value.
:P.
The result of some device functions
will be used as :HP2.final:eHP2.
:I2 refid='devfunc'.final values
values for the sequence being defined.
A final value is sent directly to the output device.
Some of the device functions produce results which are not suitable
for use as a final value.
The result of this type of function must be supplied as a parameter value
to a device function which can produce a final value.
:P.
Prior to transmitting the device function sequences to the
:I2 refid='devfunc'.translation
output device, &WGML. translates
each character of the sequence into another character.
The translation values are defined in the font definitions used
with the device.
Some of the device functions produce final values which will not
be translated.
:P.
Each device function name begins with the percent character(%) and
is immediately followed by a left parenthesis.
If the device function has any parameter values, the value(s)
follow the left parenthesis and are separated by commas.
The device function is terminated with a right parenthesis.
:H3.ADD
:I1.add
:I2 refid='dadd'.dadd
:XMP.
%ADD(123,456)
:eXMP.
:P.
The two required parameters must both be numeric.
The sum of the two parameters is returned as a numeric result.
The result of this device function may not be used as a
final value.
:H3.BINARY1
:I1.binary1
:I2 refid='dbin1'.dbinary1
:XMP.
%BINARY1(123)
:eXMP.
:P.
The required parameter must be numeric.
The result of this function is a one byte binary number
ranging from 0 to 255 inclusive.
The result of this device function is a final value,
and may not be used as a parameter
of another device function.
The result is not translated when sent to
the output device.
:H3.BINARY2
:I1.binary2
:I2 refid='dbin2'.dbinary2
:XMP.
%BINARY2(1234)
:eXMP.
:P.
The required parameter must be numeric.
The result of this function is a two byte binary number
ranging from 0 to 65535 inclusive.
The result of this device function is a final value,
and may not be used as a parameter
of another device function.
The result is not translated when sent to
the output device.
:H3.BINARY4
:I1.binary4
:I2 refid='dbin4'.dbinary4
:XMP.
%BINARY4(1234)
:eXMP.
:P.
The required parameter must be numeric.
The result of this function is a four byte binary number
ranging from 0 to 4294967295 inclusive.
:CMT.doc-- should have a reference to machine specific section.
On some machines, the largest integer value is a two byte binary
number.
If such a machine is being used, two of the four bytes will always
be zero.
The result of this device function is a final value,
and may not be used as a parameter
of another device function.
The result is not translated when sent to
the output device.
:H3.CANCEL
:IH1 print='%cancel'.cancel
:I1.cancel
:I2 refid='dcancel'.dcancel
:XMP.
%CANCEL("bold")
:eXMP.
:P.
Some devices may cancel more than one
operation with a single control sequence.
For example, some devices may stop underlining
when bolding is turned off.
The :HP2.cancel:eHP2. device function specifies
the type of device operation that has been cancelled.
&WGML. will then re-establish the cancelled operation.
The possible values of the required character parameter are
:HP1.bold:eHP1., :HP1.underline:eHP1., and the name of a font switch
method (see :HDREF refid='fswtype'.).
The name of a font switch method is specified
when the device automatically switches to a default font.
This device function may not be used as a parameter
of another device function.
:H3.CLEARPC
:I1.clearpc
:I2 refid='dclearp'.dclearpc
:XMP.
%CLEARPC()
:eXMP.
:P.
This device function causes &WGML. to clear the screen
of an IBM PC.
It is used in the device definition, primarily with the pausing
section.
There is no effect when this function is used in a driver definition.
There are no parameters to this device function, and it may not
be used as a parameter of another device function.
:H3.CLEAR3270
:I1.clear3270
:I2 refid='dclear3'.dclear3270
:XMP.
%CLEAR3270()
:eXMP.
:P.
This device function causes &WGML. to clear the screen
of an IBM 3270 type of terminal.
It is used in the device definition, primarily with the pausing
section.
There is no effect when this function is used in a driver definition.
There are no parameters to this device function, and it may not
be used as a parameter of another device function.
:H3.DATE
:I1.date
:I2 refid='ddate'.ddate
:XMP.
%DATE()
:eXMP.
:P.
The result of this device function is a character value
representing the current date.
If the symbol :HP1.&amp.date:eHP1.
:I1.date symbol
is defined, the value
of this symbol is returned.
There are no parameters to this device function, and the result
may not be used as a final value.
:H3.DECIMAL
:I1.decimal
:I2 refid='ddecima'.ddecimal
:XMP.
%DECIMAL(123)
:eXMP.
:P.
The required parameter must be numeric.
The result of this device function is a character value
representing the given number.
The result may not be used as a final value.
:H3.DEFAULT_WIDTH
:I1.default_width
:I2 refid='ddefaul'.ddefault_width
:XMP.
%DEFAULT_WIDTH()
:eXMP.
:P.
The result of this device function is a numeric value which
represents the default width of a character in the current font.
When the font changes in the document, the value returned by this
function will change accordingly.
There are no parameters to this device function, and the result
may not be used as a final value.
:H3.DIVIDE
:I1.divide
:I2 refid='ddivide'.ddivide
:XMP.
%DIVIDE(124,12)
:eXMP.
:P.
The two required parameters must both be numeric.
The dividend from the integer division of the first parameter
by the second parameter is returned as a numeric value.
The remainder resulting from the division is not returned.
The result of this device function may not be used as a
final value.
:H3.FLUSHPAGE
:I1.flushpage
:I2 refid='dflushp'.dflushpage
:XMP.
%FLUSHPAGE()
:eXMP.
:P.
This device function causes &WGML. to flush the current
page to the output device.
The page flush is obtained by printing enough blank lines to
fill the current page.
If the size of the document page is greater than the size of
the output device page, the page flush will print enough blank
lines to flush the current device page.
If no data has been output to the device, and the page is the
first page in the document, the current page will not be flushed.
There are no parameters to this device function, and it may not
be used as a parameter of another device function.
:H3.FONT_HEIGHT
:I1.font_height
:I2 refid='dfont_h'.dfont_height
:XMP.
%FONT_HEIGHT()
:eXMP.
:P.
The result of this device function is a numeric value which
represents the height of the current font.
Adding this value to the :HP1.%font_space:eHP1. value gives
the total height of the line.
The return value is an integer value in one hundredths of a point.
For example, 12.25 points is returned as the number 1225.
When the font changes in the document, the value returned by this
function will change accordingly.
There are no parameters to this device function, and the result
may not be used as a final value.
:H3.FONT_SPACE
:I1.font_space
:I2 refid='dfont_s'.dfont_space
:XMP.
%FONT_SPACE()
:eXMP.
:P.
The result of this device function is a numeric value which
represents the space between lines in the current font.
Adding this value to the :HP1.%font_height:eHP1. value gives
the total height of the line.
The return value is an integer value in one hundredths of a point.
For example, 12.25 points is returned as the number 1225.
When the font changes in the document, the value returned by this
function will change accordingly.
There are no parameters to this device function, and the result
may not be used as a final value.
:H3.FONT_NUMBER
:I1.font_number
:I2 refid='dfont_n'.dfont_number
:XMP.
%FONT_NUMBER()
:eXMP.
:P.
The result of this device function is a numeric value which
represents the number of the current font.
When the font changes in the document, the value returned by this
function will change accordingly.
There are no parameters to this device function, and the result
may not be used as a final value.
:H3.FONT_OUTNAME1
:I1.font_outname1
:I2 refid='dfont_1'.dfont_outname1
:XMP.
%FONT_OUTNAME1()
:eXMP.
:P.
The result of this device function is a character value which
represents the :HP1.outname1:eHP1. value of the current font.
The :HP1.outname1:eHP1. value is specified in each font definition.
When the font changes in the document, the value returned by this
function will change accordingly.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?