Mnemonics "S"

From CometWiki

Revision as of 02:30, 1 June 2009 by Badge (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

(SatisfyInput)

Mnemonic:  (SatisfyInput=data$)  
Discussion:  Typically, your program will be positioned at an INPUT statement when the user clicks on a hyperlink. When the event handling subroutine concludes, it returns to the same INPUT statement (assuming that you've concluded the subroutine with a RETURN statement). 
The (SatisfyInput) mnemonic provides a way for the event handling subroutine to supply input data to the original INPUT statement. Here's an outline of the process: 


display a Comet hyperlink 
set an eventsub trap 
go to the main processing section of your program, which includes an INPUT statement 
in the eventsub routine, use the (SatisfyInput) mnemonic to assign input data that will be fed to the INPUT statement when someone clicks on a hyperlink 
Thus, when the user clicks on the hyperlink, the program will branch to the event handing subroutine, where it will provide the input data to the original data entry field. This is a perfect solution 
 
Example:  Print @(40,3);"Run your favorite utility program"
Print @(40,4);(Hyperlink="Spooler","LINK7",1)
Print @(40,5);(Hyperlink="Comet Editor","LINK8",1)
Print @(40,6);(Hyperlink="Utility menu","LINK9",1)

! set EVENTSUB trap

EVENTSUB GetEvent,Event$,Source$

! MainLineProcessing
	Input @(34,20),Program$

ProgEnd:
	if (Program$ EQ "") Then_
		Program$ = "QMONITOR"

	Print (WC);(BF)
	Run Program$

! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
!
!   E V E N T   P R O C E S S I N G   S U B R O U T I N E
!
! = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

GetEvent:

	Print (WC);(BF)

	! make processing decisions based on the value of the EventString$

	Select Case Event$
	.
	.
	.
		Case "LINK7"
			TempProg$ = "QSPOOL"

		Case "LINK8"
			TempProg$ = "CED"

		Case "LINK9"
			TempProg$ = "QTILITY"
	.
	.
	.
	Endselect

! Pass result back to main-line program and exit input
	If (TempProg$ NE "")
		Print (SatisfyInput = TempProg$)
	EndIf

	! re-set Eventsub trap
EVENTSUB GetEvent,Event$,Source$

RETURN

(Save Screen)

 
Mnemonic:   (Save Screen)  
Hex equivalent:  "@040003@"  
Discussion:  This mnemonic saves the current screen display, including all text and display attributes, variables, screen colors, the screen mode, and the memory and display contents of all Comet windows that are open. This mnemonic also frees up all windows memory for the console session. 
This information is saved in a data file named "SCRN" + TERM$. This file is created automatically by Comet and placed on the first local RAM disk found among the accessed Comet directories; if no local RAM disk is found, Comet uses the current DOS directory. (This is the same directory where the partition environments are saved when ENTER statements are executed.) 

Note: This file is a DOS file, not a Comet file (i.e., there is no automatic entry in the QDIR file for this file). 

The console screen display does not change when this control is written. Your application may proceed to write new information to the screen, use windows memory blocks, etc. 

To restore the screen display, use (Restore Screen). 
 
Example:  a. 100 FORMAT (Save Screen)
   .
   PRINT (0,100

b. PRINT (0) (Save Screen)

(SB)

 
Mnemonic:   (SB)  
Hex equivalent:  "08@"  
Discussion:  Start background display. 
The (SB) control code sets background display mode and causes subsequent characters to be displayed as background (inverse video) characters. This is used for displaying data that is not expected to change, such as prompts and headings. 

Characteristics of background mode: 

Background fields are for display purposes only. Data cannot be input from a background field. 

Characters appear in the configured background color. 

The cursor cannot be positioned in a background field from the keyboard. An attempt to position the cursor in a background field with a FORMAT statement will cause the cursor to be positioned in the next available foreground field. 

Background mode must be set in each FORMAT statement where it is to be used. Unless set to background mode, the video device will display data in foreground mode. 

Foreground and background can be mixed in one FORMAT statement, as long as the appropriate control codes (i.e., (SF) and (SB)) are used to start each operation. 
 
Example:  a. 100 FORMAT (SB);(BF),@(10,0)
   .
   PRINT (0,100)

b. PRINT (0) (SB);(BF),@(10,0)

This example sets the video mode to background (SB), and blank fills the top row of the screen (i.e., row 0) from position 10 to the end of the line.  

(Scan Codes Off)

 
Mnemonic:   (Scan Codes Off)  
Hex equivalent:  "@0E000F@"  
Discussion:  This mnemonic turns off the "scan code mode." For more information, see (Full Scan Codes Passed).  
Example:  a. 100 FORMAT (Scan Codes Off)
   .
   PRINT (0,100)

b. PRINT (0) (Scan Codes Off)

(Screen)

 
Mnemonic:   (Screen=number-of-columns, number-of-rows)  
Discussion:  The (Screen) mnemonic sets the size of the COSW screen. Number-of-columns and number-of-rows are numeric values between 1 and 254. 
If you are running Comet maximized, and the virtual screen size is larger than the physical screen size, Comet automatically reduces the font size so the entire display fits on the screen. Note: This can result in very small type (e.g., if the column and row values are set to high values). 

If you are running Comet non-maximized, and the virtual screen size is larger than the physical screen size, Comet automatically inserts scroll bars (horizontal and/or vertical) on the screen. 

For a demonstration of the (Screen) mnemonic, run the CPLANY program in the DMW directory (the 98.11 version). 

Also see (CPL132), (CPL64), and (CPL80). 
 
History:  This mnemonic was added in the REL release 99.01.  
Example:  ! set screen size to 100 columns x 50 rows

Print (Screen=100,50)

(SelectFont

) 
Mnemonic:   (SelectFont);log-font-data  
Discussion:  Selects the font specified by the log-font-data structure. 
Typically, a user will call GDI.InitLogFont first to set all font fields to their default values, and then modify whichever field needs changing. 

Because the font structure consists of Internet Basic strings, the INTEL/INTELD functions must be used to effect any modifications. For an example see the GDI.InitLogFont function in the usefile #LOGFNT. 

Some commonly modified fields are: 

lfHeight$  Font size in 10th's of a point (inch/72). The font mapper looks for the largest font that does not exceed the requested size; if there is no such font, it looks for the smallest font available.  
lfWidth$  Specifies the average width, in logical units, of characters in the font. If lfWidth is zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference.  
lfEscapement$  Specifies the angle, in tenths of degrees, of each line of text written in the font (relative to the bottom of the page).  
lfOrientation$  Specifies the angle, in tenths of degrees, of each character's base line (relative to the bottom of the page).  
lfWeight$  Darkness (or lightness) of the characters  
lfItalic$  Specifies an italic font if set to TRUE.  
lfUnderline$  Specifies an underlined font if set to TRUE.  
lfStrikeOut$  Specifies a strikeout font if set to TRUE.  
lfFaceName$  Desired font face ("Arial", "Courier New", etc.)  

 
History:  This mnemonic is valid in Comet98 and greater.  

(SelectHatchBrush)

 
Mnemonic:   (SelectHatchBrush = style, red, green, blue)  
Discussion:  This mnemonic selects the hatched brush described style and red, green, blue. 
Where style can be one of the following values: 

HS.HORIZONTAL   Horizontal hatch

HS.VERTICAL     Vertical hatch

HS.FDIAGONAL    Upward hatch (left to right) at 45 degrees

HS.BDIAGONAL    Downward hatch (left to right) at 45 degrees

HS.CROSS        Horizontal and vertical crosshatch

HS.DIAGCROSS    Crosshatch at 45 degrees

Note: See SetTextColor for color parameter information. 
 
History:  This mnemonic is valid in Comet98 and greater.  

(SelectPen)

 
Mnemonic:   (SelectPen = style, width, red, green, blue)  
Discussion:  This mnemonic selects the pen described by style, width and red, green, blue. 
Available pen styles are: 

PS.SOLID  Creates a solid pen.  
PS.DASH  Creates a dashed pen. Valid only when the pen width is 1 or less, in device units.  
PS.DOT  Creates a dotted pen. Valid only when the pen width is 1 or less, in device units.  
PS.DASHDOT  Creates a pen with alternating dashes and dots. Valid only when the pen width is 1 or less, in device units.  
PS.DASHDOTDOT  Creates a pen with alternating dashes and double dots. Valid only when the pen width is 1 or less, in device units.  
PS.NULL  Creates a null pen.  
PS.INSIDEFRAME  Creates a pen that draws a line inside the frame of closed shapes produced by the Windows GDI output functions that specify a bounding rectangle (for example, the Ellipse, Rectangle, RoundRect, Pie, and Chord member functions). When this style is used with Windows GDI output functions that do not specify a bounding rectangle (for example, the LineTo member function), the drawing area of the pen is not limited by a frame. 
If the width of the pen PtrWidth is 0, the width in device units is always 1 pixel, regardless of the mapping mode. 
 


Note: See (SetTextColor) for color parameter information. 
 
History:  This mnemonic is valid in Comet98 and greater.  

(SelectSolidBrush)

 
Mnemonic:   (SelectSolidBrush = red, green, blue)  
Discussion:  This mnemonic selects the solid brush described red, green, blue. 
Note: See (SetTextColor) for color parameter information. 
 
History:  This mnemonic is valid in Comet98 and greater.  

(SelectSysFont)

 
Mnemonic:   (SelectSysFont = font-number)  
Discussion:  Selects the SYSTEM font specified by font-number. 
Where: 

font-number = a Number from 0 to 2, corresponding to an entry in the COSW.INI [Printer Fonts] section. 

Provides a system dependent method for assuring compatible printer output by allowing the system user to choose the system fonts according to what is available at that system. 

Font numbers are defined as follows: 

0 is used for normal printing
1 is used for compact (compressed) printing
2 is used for wide (expanded) printing 
 
History:  This mnemonic is valid in Comet98 and greater 

(SelectWindowEx)

 
Mnemonic:   (SelectWindowEx=handle$,flags)  
Discussion:  This mnemonic selects an extended window, using the following parameters: 
Parameter Description 
handle$ This 4-byte string value is the handle that was assigned to this window when it was created. 
flags This numeric value determines whether the selected window is activated or not: 
Value Meaning 
0 The window is not activated. 
1 This window is activated. 

 


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). 

An extended window is deleted via (DeleteWindowEx) mnemonic. 

See the WinDemo.ibs program (available at www.signature.net/download/demos) for examples of extended windows. 
 
Note:  If you write a program that displays more than one extended window at a time, your program may need some way to distinguish which window was active at the time that data was input. The STS function returns the handle of the window that generated the input. This 4-byte value starts in position 11, as shown here: 
Length 4 & Local Handle$
.
Handle$ = SUB(STS(0),11,4)

 
History:  This feature is supported in Comet2002 Build 306 and higher.  
Example:  The following example creates two extended windows, then uses the (SelectWindowEx) mnemonic to select between the two. 
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 (SelectWindowEx=Handle1$,1)  ! select window 1
Print "This text goes in window 1"
.
Print (SelectWindowEx=Handle2$,1)  ! select window 2
Print "This text goes in window 2"

(Server)

 
Email Mnemonic:   (Server=string-argument)  
Discussion:  The (Server) mnemonic specifies the smtp server and port to be used for your email printer. Get this information from the settings for your email client program. The default port is 25 (AKA "mail"). If you do not specify a port, the default will be used. 
Please note that servers requiring authentication are not supported at this time. 
 
Example:  OPEN (1) "LEH"
PRINT (1) (Server="smtp.our.mail.server.net 25")

 
 Read about other Email Mnemonics  

(Set Printer Info)

 
Mnemonic:   (SetPrinterInfo = FunctionCode, Value) 
where FunctionCode is the characteristic you want to change, and Value is the value you want to change it to 
 
Discussion:  The following FunctionCodes and Values are also contained in the file #PTRCTLD in the WDL folder. 
PI.DMORIENTATION = 0
    DMORIENT.PORTRAIT = 1
    DMORIENT.LANDSCAPE = 2

PI.DMPAPERSIZE = 1
    DMPAPER.LETTER               = 1  ! Letter 8 1/2 x 11 in
    DMPAPER.LETTERSMALL          = 2  ! Letter Small 8 1/2 x 11 in
    DMPAPER.TABLOID              = 3  ! Tabloid 11 x 17 in
    DMPAPER.LEDGER               = 4  ! Ledger 17 x 11 in
    DMPAPER.LEGAL                = 5  ! Legal 8 1/2 x 14 in
    DMPAPER.STATEMENT            = 6  ! Statement 5 1/2 x 8 1/2 in
    DMPAPER.EXECUTIVE            = 7  ! Executive 7 1/4 x 10 1/2 in
    DMPAPER.A3                   = 8  ! A3 297 x 420 mm
    DMPAPER.A4                   = 9  ! A4 210 x 297 mm
    DMPAPER.A4SMALL             = 10  ! A4 Small 210 x 297 mm
    DMPAPER.A5                  = 11  ! A5 148 x 210 mm
    DMPAPER.B4                  = 12  ! B4 (JIS) 250 x 354
    DMPAPER.B5                  = 13  ! B5 (JIS) 182 x 257 mm
    DMPAPER.FOLIO               = 14  ! Folio 8 1/2 x 13 in
    DMPAPER.QUARTO              = 15  ! Quarto 215 x 275 mm
    DMPAPER.10X14               = 16  ! 10x14 in
    DMPAPER.11X17               = 17  ! 11x17 in
    DMPAPER.NOTE                = 18  ! Note 8 1/2 x 11 in
    DMPAPER.ENV.9               = 19  ! Envelope #9 3 7/8 x 8 7/8
    DMPAPER.ENV.10              = 20  ! Envelope #10 4 1/8 x 9 1/2
    DMPAPER.ENV.11              = 21  ! Envelope #11 4 1/2 x 10 3/8
    DMPAPER.ENV.12              = 22  ! Envelope #12 4 \276 x 11
    DMPAPER.ENV.14              = 23  ! Envelope #14 5 x 11 1/2
    DMPAPER.CSHEET              = 24  ! C size sheet
    DMPAPER.DSHEET              = 25  ! D size sheet
    DMPAPER.ESHEET              = 26  ! E size sheet
    DMPAPER.ENV.DL              = 27  ! Envelope DL 110 x 220mm
    DMPAPER.ENV.C5              = 28  ! Envelope C5 162 x 229 mm
    DMPAPER.ENV.C3              = 29  ! Envelope C3  324 x 458 mm
    DMPAPER.ENV.C4              = 30  ! Envelope C4  229 x 324 mm
    DMPAPER.ENV.C6              = 31  ! Envelope C6  114 x 162 mm
    DMPAPER.ENV.C65             = 32  ! Envelope C65 114 x 229 mm
    DMPAPER.ENV.B4              = 33  ! Envelope B4  250 x 353 mm
    DMPAPER.ENV.B5              = 34  ! Envelope B5  176 x 250 mm
    DMPAPER.ENV.B6              = 35  ! Envelope B6  176 x 125 mm
    DMPAPER.ENV.ITALY           = 36  ! Envelope 110 x 230 mm
    DMPAPER.ENV.MONARCH         = 37  ! Envelope Monarch 3.875 x 7.5 in
    DMPAPER.ENV.PERSONAL        = 38  ! 6 3/4 Envelope 3 5/8 x 6 1/2 in
    DMPAPER.FANFOLD.US          = 39  ! US Std Fanfold 14 7/8 x 11 in
    DMPAPER.FANFOLD.STD.GERMAN  = 40  ! German Std Fanfold 8 1/2 x 12 in
    DMPAPER.FANFOLD.LGL.GERMAN  = 41  ! German Legal Fanfold 8 1/2 x 13 in
    DMPAPER.ISO.B4              = 42  ! B4 (ISO) 250 x 353 mm
    DMPAPER.JAPANESE.POSTCARD   = 43  ! Japanese Postcard 100 x 148 mm
    DMPAPER.9X11                = 44  ! 9 x 11 in
    DMPAPER.10X11               = 45  ! 10 x 11 in
    DMPAPER.15X11               = 46  ! 15 x 11 in
    DMPAPER.ENV.INVITE          = 47  ! Envelope Invite 220 x 220 mm
    DMPAPER.RESERVED.48         = 48  ! RESERVED--DO NOT USE
    DMPAPER.RESERVED.49         = 49  ! RESERVED--DO NOT USE
    DMPAPER.LETTER.EXTRA        = 50  ! Letter Extra 9 \275 x 12 in
    DMPAPER.LEGAL.EXTRA         = 51  ! Legal Extra 9 \275 x 15 in
    DMPAPER.TABLOID.EXTRA       = 52  ! Tabloid Extra 11.69 x 18 in
    DMPAPER.A4.EXTRA            = 53  ! A4 Extra 9.27 x 12.69 in
    DMPAPER.LETTER.TRANSVERSE   = 54  ! Letter Transverse 8 \275 x 11 in
    DMPAPER.A4.TRANSVERSE       = 55  ! A4 Transverse 210 x 297 mm
    DMPAPER.LETTER.EXTRA.TRANSVERSE = 56 ! Letter Extra Transverse 9\275 x 12 in
    DMPAPER.A.PLUS              = 57  ! SuperA/SuperA/A4 227 x 356 mm
    DMPAPER.B.PLUS              = 58  ! SuperB/SuperB/A3 305 x 487 mm
    DMPAPER.LETTER.PLUS         = 59  ! Letter Plus 8.5 x 12.69 in
    DMPAPER.A4.PLUS             = 60  ! A4 Plus 210 x 330 mm
    DMPAPER.A5.TRANSVERSE       = 61  ! A5 Transverse 148 x 210 mm
    DMPAPER.B5.TRANSVERSE       = 62  ! B5 (JIS) Transverse 182 x 257 mm
    DMPAPER.A3.EXTRA            = 63  ! A3 Extra 322 x 445 mm
    DMPAPER.A5.EXTRA            = 64  ! A5 Extra 174 x 235 mm
    DMPAPER.B5.EXTRA            = 65  ! B5 (ISO) Extra 201 x 276 mm
    DMPAPER.A2                  = 66  ! A2 420 x 594 mm
    DMPAPER.A3.TRANSVERSE       = 67  ! A3 Transverse 297 x 420 mm
    DMPAPER.A3.EXTRA.TRANSVERSE = 68  ! A3 Extra Transverse 322 x 445 mm

PI.DMPAPERLENGTH = 2
PI.DMPAPERWIDTH = 3
PI.DMSCALE = 4
PI.DMPRINTQUALITY = 5
    DMRES.DRAFT     = 65535 ! -1
    DMRES.LOW       = 65534 ! -2
    DMRES.MEDIUM    = 65533 ! -3
    DMRES.HIGH      = 65532 ! -4

PI.DMCOLOR = 6
    DMCOLOR.MONOCHROME = 1
    DMCOLOR.COLOR    = 2

PI.DMCOLLATE = 7
    DMCOLLATE.FALSE = 0
    DMCOLLATE.TRUE = 1

PI.DMDEFAULTSOURCE = 8
    DMBIN.UPPER         = 1
    DMBIN.ONLYONE       = 1
    DMBIN.LOWER         = 2
    DMBIN.MIDDLE        = 3
    DMBIN.MANUAL        = 4
    DMBIN.ENVELOPE      = 5
    DMBIN.ENVMANUAL     = 6
    DMBIN.AUTO          = 7
    DMBIN.TRACTOR       = 8
    DMBIN.SMALLFMT      = 9
    DMBIN.LARGEFMT      = 10
    DMBIN.LARGECAPACITY = 11
    DMBIN.CASSETTE      = 14
    DMBIN.FORMSOURCE    = 15

(Set ROP2)

Mnemonic:  (SetROP2 = Mode)  
Discussion:  Sets the current foreground mix mode. GDI uses the foreground mix mode to combine pens and interiors of filled objects with the colors already on the screen. The foreground mix mode defines how colors from the brush or pen and the colors in the existing image are to be combined. 
Where Mode can be any of the following values: 

Mix mode Description 
R2.BLACK = 1 Pixel is always 0. 
R2.COPYPEN = 13 Pixel is the pen color. 
R2.MASKNOTPEN = 3 Pixel is a combination of the colors common to both the screen and the inverse of the pen. 
R2.MASKPEN = 9 Pixel is a combination of the colors common to both the pen and the screen. 
R2.MASKPENNOT = 5 Pixel is a combination of the colors common to both the pen and the inverse of the screen. 
R2.MERGENOTPEN = 12 Pixel is a combination of the screen color and the inverse of the pen color. 
R2.MERGEPEN = 15 Pixel is a combination of the pen color and the screen color. 
R2.MERGEPENNOT = 14 Pixel is a combination of the pen color and the inverse of the screen color. 
R2.NOP = 11 Pixel remains unchanged. 
R2.NOT = 6 Pixel is the inverse of the screen color. 
R2.NOTCOPYPEN = 4 Pixel is the inverse of the pen color. 
R2.NOTMASKPEN = 8 Pixel is the inverse of the R2_MASKPEN color. 
R2.NOTMERGEPEN = 2 Pixel is the inverse of the R2_MERGEPEN color. 
R2.NOTXORPEN = 10 Pixel is the inverse of the R2_XORPEN color. 
R2.WHITE = 16 Pixel is always 1. 
R2.XORPEN = 7 Pixel is a combination of the colors in the pen and in the screen, but not in both. 

(Set Window Caption)

 
Mnemonic:  (Set Window Caption=caption$,flag)  
Discussion:  This mnemonic sets the window caption. 
The flag parameter may contain the following values: 

0 = Show specified caption as is (Main view or selected window)
1 = Include standard caption (Comet TXX) with specified caption (Main view only)
2 = Use default specified in COSW.INI ([Comet] IncludeStdCaption) (Main view only) 
 
History:  This mnemonic was added in REL Version 02.04.  
Example:  Print (Set Window Caption = "This is the caption",0)
Personal tools