Mnemonics "D"

From CometWiki

Revision as of 20:13, 26 January 2010 by Jim (Talk | contribs)
Jump to: navigation, search

Contents

(DE)

Mnemonic: (DE) Hex equivalent: "@0404@"

Discussion: Default characters per line. This control code sets the default number of characters per line.
The default value is established in the terminal setup, the terminal emulator setup, or the console setup, depending on the type of device being used.

Also see (Screen), (CPL132), (CPL64), and (CPL80).

Example:

a. 100 FORMAT (DE)
  .
  PRINT (0,100)
b. PRINT (0) (DE)

(Delete Window)

Mnemonic: (Delete Window) Hex equivalent: "@0E0D01@"

Discussion: This mnemonic deletes a Comet window.
If multiple windows have been created, this mnemonic deletes the most recently displayed window.
When a window is deleted, the memory it used is returned to the amount of available window memory.
To determine how much window memory remains, perform a numeric input immediately following the deletion of a window.
See the window memory page for more information.
If you do not need to know how much window memory remains, perform a null INPUT immediately after printing the (Delete Window) mnemonic.

Also see the discussion on Comet windows.

Example:

a. 100 FORMAT (Delete Window)
  .
  PRINT (0,100)
  INPUT (0) ""
b. PRINT (0) (Delete Window)
  INPUT (0) ""

(DeleteWindowEx)

Mnemonic: (DeleteWindowEx=handle$)

Discussion: This mnemonic deletes an extended window.
Each extended window is identified by a 4-byte string known as a window handle.
The handle value is assigned by the system and returned to the Internet Basic program via an INPUT statement following the (CreateWindowEx).

See the WinDemo.ibs program (available at www.signature.net/download/demos) for examples of extended windows.

Also see (SelectWindowEx).

History: This feature is supported in Comet2002 Build 306 and higher.

Example: The following example creates two extended windows, then uses the (DeleteWindowEx) mnemonic to delete them.

Length 4 & Local Handle1$,Handle2$
.
Print (CreateWindowEx=0,0,35,15,68,0,"Window 1")
Input Handle1$
.
Print (CreateWindowEx=0,40,20,10,68,0,"Window 2")
Input Handle2$
.
.
.
Print (DeleteWindowEx=Handle1$)   ! delete window 1
Print (DeleteWindowEx=Handle2$)   ! delete window 2

(Document)

Mnemonic: (Document=string-argument, string argument)

Discussion: The (Document) mnemonic specifies a file name and Comet directory to be used for pdf, html, or txt print files.
You may issue the mnemonic several times to produce multiple uniquely-named copies of the output file.
Because a qdir entry will not be created for this file, you may use long filenames.
CosP uses CometLib to make the document copies.
Thus, a COM license is required to use this mnemonic.
The first string-argument is a string constant or variable containing the file name.
If the name does not contain an extension, the appropriate one (.pdf, .html, or .txt) will be added depending on the type of printer being used.
The second string-argument is the 3-character name of the CFAM directory where the file will be created.

If the second argument is an empty string, it is assumed that the first argument is a fully qualified windows path to the output file.
This may point to a CFAM or non CFAM controlled directory.
This path may not contain a directory alias. If a directory alias is required, use the (GetDirAlias) mnemonic to build the path.

Note: Do not confuse the (Document) mnemonic's use with that of (SpoolMessage).
They serve two different purposes and may both be used on the same document.
While the (Document) mnemonic is used to copy the document to any CFAM directory or windows path, the (SpoolMessage) mnemonic is used to name the document stored in a configured Archive.

The (Document) mnemonic is not available for CometAnywhere Clients.

Example:

OPEN(1) "LPH"
PRINT(1) (DOCUMENT="Sales Report","RPT")
PRINT(1) (DOCUMENT="\\MyServer\archive\Sales Report 05-14-08.htm","")

(Domain)

Email Mnemonic: (Domain=string-argument)

Discussion: The (Domain) mnemonic may be used to specify a domain name for the the smtp server for your email printer. If not specified, the email printer will supply the same domain as designated in the (Server=) mnemonic.

Example:  
  OPEN (1) "LEH"
  PRINT (1) (Server="smtp.our.mail.server.net 25")
  PRINT (1) (Domain="our.mail.server.net")

(Draw Bit Map)

This mnemonic has been replaced by (DrawImage)

Mnemonic: (Draw Bit Map=left, top, right, bottom, scaleX, scaleY, flags); filename

Discussion: This mnemonic draws the bitmap contained in the file (.BMP/.JPG) specified in filename in the rectangle specified by left, top, right, bottom using the format codes contained in flags.

Scaling factors can be specified in scaleX, scaleY. Valid format code are:

BMR.FIT.TO.RECT         Stretch (or shrink) bitmap to fit rectangle. Cannot be used with any other codes
 or
BMR.CENTER.HZ.RECT      Center the bitmap horizontally in rectangle
BMR.CENTER.VT.RECT      Center the bitmap vertically in rectangle
BMR.SCALE               Multiply dimensions by scaling factors below

When scaling, values contained in ScaleX and ScaleY are converted to floating point, divided by 100, and then multiplied by their respective axis to providing scaling by as little as 1 percent. Scaling example:

To double only the horizontal size of a bitmap:

ScaleX = 200  ! * 2 ScaleY = 100  ! * 1

To halve a bitmap ScaleX = 50  ! * .5 ScaleY = 50  ! * .5

To convert bitmap pixels to .01 inch: ScaleX = 1440  ! * 14.40 (TWIPS/inch) ScaleY = 1440  ! * 14.40 (TWIPS/inch)

'@00@' must be appended to the file name.

See (Draw Image).

History: This mnemonic is valid in Comet98 and greater.

(Draw box)

Mnemonic: (Draw box=a,b,c,d)
where:
a = upper left column (decimal)
b = upper left row (decimal)
c = lower right column (decimal)
d = lower right row (decimal)

Hex equivalent: --
Discussion: This mnemonic draws a graphical box using the specified screen coordinates (decimal values). Note: The box overwrites any text displayed on the screen within the specified coordinates (i.e., this is not a "window").

Also see the discussion on Comet windows.

 
Example:  
a. 100 FORMAT (Draw box=2,3,5,10)
   .
   PRINT (0,100

b. PRINT (0) (Draw box=2,3,5,10)

(Draw Image)

Mnemonic: (Draw Image=left, top, right, bottom, scaleX, scaleY, flags, filename)

Discussion: This mnemonic draws the bitmap contained in the file (.BMP/.JPG) specified in filename in the rectangle specified by left, top, right, bottom using the format codes contained in flags. Scaling factors can be specified in scaleX, scaleY. (Draw Image) performs the same function as (Draw Bitmap), except that the filename is included as an argument of the mnemonic instead of a field following the mnemonic. This makes it unnecessary to add a trailing "@00@" to the filename.

Valid format code are:

BMR.FIT.TO.RECT (1)        Stretch (or shrink) bitmap to fit rectangle. Cannot be used with any other codes
 or
BMR.CENTER.HZ.RECT (2)     Center the bitmap horizontally in rectangle
BMR.CENTER.VT.RECT (4)     Center the bitmap vertically in rectangle
BMR.SCALE (8)              Multiply dimensions by scaling factors below

When scaling, values contained in ScaleX and ScaleY are converted to floating point, divided by 100, and then multiplied by their respective axis to providing scaling by as little as 1 percent. Scaling example:

To double only the horizontal size of a bitmap:

ScaleX = 200  ! * 2 ScaleY = 100  ! * 1

To halve a bitmap ScaleX = 50  ! * .5 ScaleY = 50  ! * .5

To convert bitmap pixels to .01 inch: ScaleX = 1440  ! * 14.40 (TWIPS/inch) ScaleY = 1440  ! * 14.40 (TWIPS/inch)

History: This mnemonic is valid in Comet98 and greater.

(Draw Text)

Mnemonic: (Draw Text=left, top, right, bottom, flags); printable-text

Discussion: Prints the specified printable-text into the rectangle specified by the coordinates left, top, right, bottom using the format codes specified in flags.
Call this member function to format text in the given rectangle. It formats text by expanding tabs into appropriate spaces, aligning text to the left, right, or center of the given rectangle, and breaking text into lines that fit within the given rectangle, and breaking text into lines that fit within the given rectangle. The type of formatting is specified by flags.

The formatting codes can be combined and are specified in flags.

DT.TOP Specifies top-justified text (single line only).
DT.LEFT Aligns text flush-left.
DT.CENTER Centers text horizontally.
DT.RIGHT Aligns text flush-right.
DT.VCENTER Specifies vertically centered text (single line only).
DT.BOTTOM Specifies bottom-justified text. This value must be combined with DT.SINGLELINE.
DT.WORDBREAK Specifies word-breaking. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by left, top, right, bottom. A carriage return-linefeed sequence will also break the line.
DT.SINGLELINE Specifies single line only. Carriage returns and linefeeds do not break the line.
DT.EXPANDTABS Expands tab characters. The default number of characters per tab is eight.
DT.TABSTOP Sets tab stops. The high-order byte of PtrFlags is the number of characters for each tab. The default number of characters per tab is eight.
DT.NOCLIP Draws without clipping. DrawText is somewhat faster when DT.NOCLIP is used.
DT.EXTERNALLEADING Includes the font's external leading in the line height. Normally, external leading is not included in the height of a line of text.
DT.CALCRECT Returns the height of the formatted text, but does not draw the text.
DT.NOPREFIX Turns off processing of prefix characters. Normally, DrawText interprets the ampersand (&) mnemonic-prefix character as a directive to underscore the character that follows, and the two-ampersand (&&) mnemonic- prefix characters as a directive to print a single ampersand. By specifying DT.NOPREFIX, this processing is turned off.
DT.INTERNAL Uses the system font to calculate text metrics.
DT.EDITCONTROL Duplicates the text-displaying characteristics of a multiline edit control. Specifically, the average character width is calculated in the same manner as for an edit control, and the function does not display a partially visible last line.
DT.PATH.ELLIPSIS See DT.END.ELLIPSIS Below
DT.END.ELLIPSIS Replaces part of the given string with ellipses, if necessary, so that the result fits in the specified rectangle. The given string is not modified unless the DT.MODIFYSTRING flag is specified.

You can specify DT.END.ELLIPSIS to replace characters at the end of the string, or DT.PATH.ELLIPSIS to replace characters in the middle of the string. If the string contains backslash (\) characters,

DT.PATH.ELLIPSIS preserves as much as possible of the text after the last backslash.
DT.MODIFYSTRING Modifies the given string to match the displayed text. This flag has no effect unless the
DT_END_ELLIPSIS or DT_PATH_ELLIPSIS flag is specified.
DT.RTLREADING Layout in right to left reading order for bi-directional text when the font selected into the hdc is a Hebrew or Arabic font. The default reading order for all text is left to right.
DT.WORD.ELLIPSIS Truncates text that does not fit in the rectangle and adds ellipses.

NOTE: The values DT.CALCRECT, DT.EXTERNALLEADING, DT.INTERNAL, DT.NOCLIP, and DT.NOPREFIX cannot be used with the DT.TABSTOP value.

History: This mnemonic is valid in Comet98 and greater.

Personal tools