Mnemonics "E"
From CometWiki
(Difference between revisions)
Line 1: | Line 1: | ||
== (Easy Scan) == | == (Easy Scan) == | ||
+ | |||
<pre> | <pre> | ||
Mnemonic: (Easy Scan) | Mnemonic: (Easy Scan) |
Revision as of 21:27, 31 May 2009
(Easy Scan)
Mnemonic: (Easy Scan) Hex equivalent: "@0E0000@" Discussion: The (Easy Scan) mnemonic places the Comet console into "easy scan" mode. (This mnemonic does not apply to QTerm or terminals.) In "easy scan" mode, if the user presses one of the recognized keys while the program is at an INPUT prompt, the program responds as if an F10, Enter, or Tab key was pressed. In combination with the returned screen coordinates (see INPUT), this feature allows for an enriched style of screen I/O programming. In addition, if the mouse driver is active (see the (Mouse On) mnemonic), a mouse click also generates a transmit, and places the cursor's coordinates in the status buffer (see Example 2). Starting with Comet98 Build 232, (Easy Scan) turns the mouse on if it is not already being done. The (Scan Codes Off) mnemonic terminates "easy scan" mode. The "reason for transmit" information is stored in the 8th byte of the console's status buffer, and is stored in hex. To determine which key (or click) caused the transmit to occur, perform the following operation: VALUE = ASC(SUB(STS(0),8,1)) Note: VALUE is a numeric field with length/precision of 3.0. The following values are returned: Value Key that caused the transmit to occur 4 Up arrow 5 Down arrow 6 Left mouse click 7 Ctrl + Home 8 Ctrl + End 9 Pg Up 10 Ctrl + Pg Up 11 Pg Dn 12 Ctrl + Pg Dn 14 Right mouse click 15 Window caption bar "X" was clicked. See (CreateWindowEx). Values 1, 2, and 3 are generated via the INPUT statement, and do not require the (Easy Scan) mnemonic. History: The (Easy Scan) mnemonic was added in Comet version 504.208 as part of the enhanced INPUT statement. Values 7 through 12 were added in Comet 504.228 and Comet98 Build 228. Starting with Comet98 Build 232, (EasyScan) turns the mouse on if it is not already being done. If it is already on, it is assumed the whoever turned it on will also turn it off. Starting with Build 292, (EasyScan) disables any scan modes that are currently enabled. Value 14 was added in Build 294. As of Build 294, (EasyScan) mouse clicks now occur on the up-click instead of the down-click. This is consistent with other Windows applications. Value 15 was added in Comet2002 Build 306. Example 1: PRINT (0) (Mouse On) ! Mouse on (optional) . PRINT (0) (Easy Scan) ! Easy scan mode on . . . INPUT (0) DATA$ ! Input a field VALUE = ASC(SUB(STS(0),8,1)) ! Reason for transmit IF VALUE = 1 ... ! F10 key IF VALUE = 2 ... ! Enter key IF VALUE = 3 ... ! Tab key IF VALUE = 4 ... ! Up arrow IF VALUE = 5 ... ! Down arrow IF VALUE = 6 ... ! Left mouse click IF VALUE = 7 ... ! Ctrl + Home IF VALUE = 8 ... ! Ctrl + End IF VALUE = 9 ... ! Pg Up IF VALUE = 10 ... ! Ctrl + Pg Up IF VALUE = 11 ... ! Pg Dn IF VALUE = 12 ... ! Ctrl + Pg Dn IF VALUE = 14 ... ! Right mouse click IF VALUE = 15 ... ! Window caption bar "X" . . . PRINT (0) (ScanCodesOff) ! Easy scan mode off PRINT (0) (Mouse Off) ! Mouse off (optional) Example 2: Data$ = Sub(Sts(0), 1, 254) ! Get console status J = Asc(Sub(Data$, 8, 1)) ! Get reason for transmit If (J EQ 6) ! Mouse was clicked Row = Asc(Sub(Data$, 15, 1)) ! Get the row Col = Asc(sub(Data$, 16, 1)) ! Get the column Endif This example shows how to determine the cursor's coordinates when the mouse is clicked. == (Ellipse) == Mnemonic: (Ellipse=left, top, right, bottom) Discussion: This mnemonic draws an ellipse. The center of the ellipse is the center of the bounding rectangle specified by left, top, right, bottom. The ellipse is drawn with the current pen, and its interior is filled with the current brush. The figure drawn by this function extends up to, but does not include, the right and bottom coordinates. This means that the height of the figure is bottom - top and the width of the figure is right - left. If either the width or the height of the bounding rectangle is 0, no ellipse is drawn. History: This mnemonic is valid in Comet98 and greater == (EmailDocument) == Email Mnemonic: (EmailDocument=string-argument) Discussion: The (EmailDocument) mnemonic may be used to specify the name associated with an attachment file. If an extension is not assigned, one appropriate for the file type will automatically be included (.pdf, .htm, etc). If this mnemonic is not used, the attachment will carry the default name assigned to the document. Example: OPEN (1) "LEH" PRINT (1) (EmailDocument="OrderDetails") == Email printer mnemonics == Mnemonic Description (Server = SMTPServerName$) Specify SMTP server name and port (Domain = Domain$) Specify email domain name (From = FromAddr$) Specify sender's name and address (To = ToAddr$) Specify recipient's name and address (CC = CCaddr$) Specify CC recipient's name and address (BCC = BCCaddr$) Specify BCC recipient's name and address (Subject = Subject$) Specify message's subject line (Text = Text$) Specify a line of body text (EmailDocument = Name$) Specify a name for the attachment (Log = LogFile$,LogDir$,ERASE) Specify a log file name and erase parameter Discussion of the Email Printer (requires access to web site) Read about other Email Mnemonics == (EN) == Mnemonic: (EN) Hex equivalent: "@0E06@" Discussion: Enter normal mode. The (EN) control code sets the video display in normal mode. The location of displayed information, the placement of the cursor, and the places where data is transmitted are determined by the FORMAT statements in the program. The alternative to normal mode is typewriter mode. Example: a. 100 FORMAT (EN);(SB);"CUSTOMER INQUIRY",@(10,0) . PRINT (0,100) b. PRINT (0) (EN);(SB);"CUSTOMER INQUIRY",@(10,0) This example shows how to set normal mode, either at the beginning of a FORMAT statement or within a PRINT statement. The additional controls set background mode and display a heading at column 10, row 0. == (End Metafile) == Mnemonic: (EndMetafile = flags) Discussion: End the metafile collection process by saving and/or executing the currently active MetaFile. Where flags indicate: VMF.SAVE = 0 ! Save the file - do not execute VMF.EXECUTE = 1 ! Execute the metafile == (EndWaitCursor) == Mnemonic: (EndWaitCursor) Discussion: This mnemonic turns off the hourglass cursor. See (BeginWaitCursor) and (RestoreWaitCursor). Example: Print (BeginWaitCursor) . . . Print (EndWaitCursor) == (Enhanced Mouse On) == Mnemonic: (Enhanced Mouse On) Hex equivalent: "@0E0906@" Discussion: This control opens the enhanced mouse driver (if possible). Also see (BIOS Mouse On) and (Mouse On). Example: a. 100 FORMAT (Enhanced Mouse On) . PRINT (0,100) b. PRINT (0) (Enhanced Mouse On == (EN) == Mnemonic: (EN) Hex equivalent: "@0E06@" Discussion: Enter normal mode. The (EN) control code sets the video display in normal mode. The location of displayed information, the placement of the cursor, and the places where data is transmitted are determined by the FORMAT statements in the program. The alternative to normal mode is typewriter mode. Example: a. 100 FORMAT (EN);(SB);"CUSTOMER INQUIRY",@(10,0) . PRINT (0,100) b. PRINT (0) (EN);(SB);"CUSTOMER INQUIRY",@(10,0) This example shows how to set normal mode, either at the beginning of a FORMAT statement or within a PRINT statement. The additional controls set background mode and display a heading at column 10, row 0. == (ET) == Mnemonic: (ET) Hex equivalent: "@0E05@" Discussion: Enter typewriter mode. The (ET) control code sets the video display in typewriter mode. Each new line of data written to the screen causes the screen to scroll up one line. The new line of data is written on the bottom line of the screen in background mode. Transmit marks are automatically placed after the last byte of data written and at the lower right corner of the screen (making the remaining part of the bottom line the foreground data entry field). The cursor is placed at the left-most position of the foreground field on the bottom line. The alternative to typewriter mode is normal mode. Example: a. 100 FORMAT (ET) . PRINT (0,100) PRINT (0) "ENTER CUSTOMER NUMBER:" INPUT (0) CUSTNUM$ b. PRINT (0) (ET) PRINT (0) "ENTER CUSTOMER NUMBER:" INPUT (0) CUSTNUM$ In this example, the screen is placed into typewriter mode. Then a prompt is displayed and data is accepted into the variable named CUSTNUM$. Items such as foreground, background and transmit marks are handled automatically. == (EraseFile) == Mnemonic: (EraseFile=file,flags) Discussion: The mnemonic erases a Windows file. This mnemonic may be used by foreground programs only. The file name is in Windows format, UNC format, or a directory alias. Flags is the sum of the specified decimal values from the following chart: Flag Description 1 Perform function at CometAnywhere remote system 2 If not CometAnywhere, then substitute local for remote If the program is running on a local Comet system (not on a CometAnywhere client system), this flag substitutes the local drive/path name for a remote path/drive name. After this mnemonic is issued, your program can issue an INPUT on LUN (0) to retrieve the error information. For example: LENGTH 2 & LOCAL AX$,DX$ LENGTH 254 & LOCAL RESULT$ ResultFmt: FORMAT AX$;DX$;RESULT$ . . Print (EraseFile=File$,Flags) Input (0,ResultFmt) The first field, AX$, contains the function error code, and the second field, DX$, contains the suberror code (aka the Windows file error code). Both of these fields are in Intel 2's complement format, and should be processed as follows: AX$ = SUB(AX$,2,1) + SUB(AX$,1,1) ! Flip the bytes around DX$ = SUB(DX$,2,1) + SUB(DX$,1,1) ! Flip the bytes around FuncError = HexDec(AX$) ! Function error code (decimal) FileError = HexDec(DX$) ! File error code (decimal) ! For unexpected values, convert to 2's complement signed integer If (FuncError > 32767) FuncError = FuncError-65536 If (FileError > 32767) FileError = FileError-65536 Here is a list of the function error codes in decimal form: Error (FuncError) Description 0 Function not supported 1 Success 2 CometAnywhere required 3 Source file error (see suberrors) 4 Aborted by user 5 Function in progress Here is a list of the suberror codes (common Windows file errors) in decimal form: Suberror (FileError) Description 0 Success 2 File not found 3 Path not found 5 Access denied 12 Invalid access 15 Invalid drive 16 An error has occurred in the current directory 18 No more files 32 Sharing violation 33 Lock violation 80 File exists 161 Bad pathname History: This mnemonic was added in Comet Build 299 and REL Version 01.07. == Execute Metafile == Mnemonic: (ExecuteMetafile = FileName) Discussion: Executes the previously saved metafile FileName.