Mnemonics "E"

From CometWiki

(Difference between revisions)
Jump to: navigation, search
((Enable Close))
 
(30 intermediate revisions not shown)
Line 1: Line 1:
-
== (Easy Scan) ==
+
==(Easy Scan)==
-
<pre>
 
-
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.  
+
'''Mnemonic''':    (Easy Scan)  Hex equivalent:  "@0E0000@" 
 +
 
 +
'''Discussion''':  The (Easy Scan) mnemonic places the Comet console into "easy scan" mode.<br>
 +
(This mnemonic does not apply to QTerm or terminals.) <br>
 +
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.<br>
 +
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).<br>
 +
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 (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:  
+
The "reason for transmit" information is stored in the 8th byte of the console's status buffer, and is stored in hex.<br>
 +
To determine which key (or click) caused the transmit to occur, perform the following operation:  
VALUE = ASC(SUB(STS(0),8,1))  
VALUE = ASC(SUB(STS(0),8,1))  
-
Note: VALUE is a numeric field with length/precision of 3.0.  
+
'''Note:''' VALUE is a numeric field with length/precision of 3.0.  
The following values are returned:  
The following values are returned:  
Value Key that caused the transmit to occur  
Value Key that caused the transmit to occur  
-
4 Up arrow  
+
*4 Up arrow  
-
5 Down arrow  
+
*5 Down arrow  
-
6 Left mouse click  
+
*6 Left mouse click  
-
7 Ctrl + Home  
+
*7 Ctrl + Home  
-
8 Ctrl + End  
+
*8 Ctrl + End  
-
9 Pg Up  
+
*9 Pg Up  
-
10 Ctrl + Pg Up  
+
*10 Ctrl + Pg Up  
-
11 Pg Dn  
+
*11 Pg Dn  
-
12 Ctrl + Pg Dn  
+
*12 Ctrl + Pg Dn  
-
14 Right mouse click  
+
*14 Right mouse click  
-
15 Window caption bar "X" was clicked. See (CreateWindowEx).   
+
*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.  
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.  
+
'''History:''' The (Easy Scan) mnemonic was added in Comet version 504.208 as part of the enhanced INPUT statement. <br>
Values 7 through 12 were added in Comet 504.228 and Comet98 Build 228.  
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 Comet98 Build 232, (EasyScan) turns the mouse on if it is not already being done. <br>
 +
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.  
Starting with Build 292, (EasyScan) disables any scan modes that are currently enabled.  
Line 44: Line 49:
Value 14 was added in Build 294.  
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.  
+
As of Build 294, (EasyScan) mouse clicks now occur on the up-click instead of the down-click.<br>
 +
This is consistent with other Windows applications.  
Value 15 was added in Comet2002 Build 306.  
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
+
Example 1: 
-
 
+
PRINT (0) (Mouse On)          ! Mouse on (optional)
-
IF VALUE = 1 ...              ! F10 key
+
.
-
IF VALUE = 2 ...              ! Enter key
+
PRINT (0) (Easy Scan)          ! Easy scan mode on
-
IF VALUE = 3 ...              ! Tab key
+
.
-
IF VALUE = 4 ...              ! Up arrow
+
.
-
IF VALUE = 5 ...              ! Down arrow
+
INPUT (0) DATA$                ! Input a field
-
IF VALUE = 6 ...              ! Left mouse click
+
.
-
IF VALUE = 7 ...              ! Ctrl + Home
+
VALUE = ASC(SUB(STS(0),8,1))  ! Reason for transmit
-
IF VALUE = 8 ...              ! Ctrl + End
+
.
-
IF VALUE = 9 ...              ! Pg Up
+
IF VALUE = 1 ...              ! F10 key
-
IF VALUE = 10 ...              ! Ctrl + Pg Up
+
IF VALUE = 2 ...              ! Enter key
-
IF VALUE = 11 ...              ! Pg Dn
+
IF VALUE = 3 ...              ! Tab key
-
IF VALUE = 12 ...              ! Ctrl + Pg Dn
+
IF VALUE = 4 ...              ! Up arrow
-
IF VALUE = 14 ...              ! Right mouse click
+
IF VALUE = 5 ...              ! Down arrow
-
IF VALUE = 15 ...              ! Window caption bar "X"
+
IF VALUE = 6 ...              ! Left mouse click
-
.
+
IF VALUE = 7 ...              ! Ctrl + Home
-
.
+
IF VALUE = 8 ...              ! Ctrl + End
-
.
+
IF VALUE = 9 ...              ! Pg Up
-
PRINT (0) (ScanCodesOff)      ! Easy scan mode off
+
IF VALUE = 10 ...              ! Ctrl + Pg Up
-
PRINT (0) (Mouse Off)          ! Mouse off (optional)
+
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
+
'''Example 2:''' 
-
J = Asc(Sub(Data$, 8, 1))      ! Get reason for transmit
+
  Data$ = Sub(Sts(0), 1, 254)    ! Get console status
-
If (J EQ 6)                    ! Mouse was clicked
+
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
   Row = Asc(Sub(Data$, 15, 1)) ! Get the row
   Col = Asc(sub(Data$, 16, 1)) ! Get the column
   Col = Asc(sub(Data$, 16, 1)) ! Get the column
-
Endif
+
Endif
-
This example shows how to determine the cursor's coordinates when the mouse is clicked.
+
This example shows how to determine the cursor's coordinates when the mouse is clicked.
-
</pre>
+
 
-
== (Ellipse) ==
+
==(Ellipse)==
-
<pre>
+
'''Mnemonic''':  (Ellipse=left, top, right, bottom)   
-
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.  
+
'''Discussion''':  This mnemonic draws an ellipse.  
-
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.  
+
The center of the ellipse is the center of the bounding rectangle specified by left, top, right, bottom. <br>
 +
The ellipse is drawn with the current pen, and its interior is filled with the current brush.<br>
 +
The figure drawn by this function extends up to, but does not include, the right and bottom coordinates.<br>
 +
This means that the height of the figure is bottom - top and the width of the figure is right - left.<br>
If either the width or the height of the bounding rectangle is 0, no ellipse is drawn.  
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  
+
'''History:''' This mnemonic is valid in Comet98 and greater
-
</pre>
+
 
== (EmailDocument) ==
== (EmailDocument) ==
-
<pre>
+
'''Email Mnemonic:'''   (EmailDocument=string-argument)   
-
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")
+
 +
'''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. 
 +
<pre>
 +
Example:
 +
OPEN (1) "LEH"
 +
PRINT (1) (EmailDocument="OrderDetails")
</pre>
</pre>
 +
==  Email printer mnemonics ==
==  Email printer mnemonics ==
-
<pre>
 
-
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 
 
-
 
 +
{| border="1"
 +
|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)  
Discussion of the Email Printer (requires access to web site)  
-
Read about other Email Mnemonics  
+
Read about other Email Mnemonics
-
</pre>
+
 
== (EN) ==
== (EN) ==
-
<pre>
+
 
-
Mnemonic:  (EN)   
+
'''Mnemonic:'''   (EN)   
-
Hex equivalent:  "@0E06@"
+
 
-
Discussion:  Enter normal mode.  
+
'''Hex equivalent:''' "@0E06@"
-
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.  
+
 
 +
'''Discussion:''' Enter normal mode.<br>
 +
The (EN) control code sets the video display in normal mode.<br>
 +
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.  
The alternative to normal mode is typewriter mode.  
   
   
-
Example:  a. 100 FORMAT (EN);(SB);"CUSTOMER INQUIRY",@(10,0)
+
'''Example:  a'''.
 +
  100 FORMAT (EN);(SB);"CUSTOMER INQUIRY",@(10,0)
   .
   .
   PRINT (0,100)
   PRINT (0,100)
-
b. PRINT (0) (EN);(SB);"CUSTOMER INQUIRY",@(10,0)
+
'''Example 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. <br>
 +
The additional controls set background mode and display a heading at column 10, row 0.
 +
 
 +
== (Enable Close) ==
 +
 
 +
'''Mnemonic:'''  (EnableClose = Arg)
 +
 
 +
Where:
 +
 
 +
Arg = 0 – Disable [X] on main view window (If [X] is clicked the message: "Close has been disabled by the currently running program" will be displayed)
 +
 
 +
Arg = 1 – Enable [X] on main view window if disable count reaches 0 (see discussion below)
 +
 
 +
Arg = <anyothervalue> – Reset count and enable [X] on main view window
 +
 
 +
'''Discussion''':  Enables or disables the [X] close button at the top of a main Comet Window. Due to the possibility of nested programs calling this mnemonic, Comet will maintain a count of the number of “disables” issued. Only when the disable count reaches 0 will the close button be enabled. If a value other than 0 or 1 is issued then the disable count will be forced to 0 and the close button will be enabled. This mnemonic requires at minimum Comet build 451 and REL version 11.10.
 +
 +
'''Example:'''
 +
  Print (EnableClose = 0)  ! Disable [X] button while processing
 +
.
 +
. ! Perform uninterrupted processing
 +
.
 +
  Print (EnableClose = 1)  ! Done - Enable [X] button
-
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. 
 
-
</pre>
 
== (End Metafile) ==
== (End Metafile) ==
-
<pre>
+
 
-
Mnemonic:  (EndMetafile = flags)   
+
'''Mnemonic:''' (EndMetafile = flags)  
-
Discussion:  End the metafile collection process by saving and/or executing the currently active MetaFile.  
+
   
 +
'''Discussion''':  End the metafile collection process by saving and/or executing the currently active MetaFile.  
 +
 
Where flags indicate:  
Where flags indicate:  
-
VMF.SAVE = 0    ! Save the file - do not execute
+
VMF.SAVE = 0    ! Save the file - do not execute<br>
VMF.EXECUTE = 1 ! Execute the metafile
VMF.EXECUTE = 1 ! Execute the metafile
-
+
 
-
</pre>
+
== (EndWaitCursor) ==
== (EndWaitCursor) ==
-
<pre>
 
-
Mnemonic:  (EndWaitCursor) 
 
-
Discussion:  This mnemonic turns off the hourglass cursor.
 
-
See (BeginWaitCursor) and (RestoreWaitCursor).
 
   
   
-
ExamplePrint (BeginWaitCursor)
+
'''Mnemonic''':  (EndWaitCursor)   
-
.
+
-
.
+
-
.
+
-
Print (EndWaitCursor)
+
-
</pre>
+
-
== (Enhanced Mouse On) ==
+
-
<pre>
+
-
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
+
'''Discussion:'''  This mnemonic turns off the hourglass cursor.  
 +
 
 +
'''See''' (BeginWaitCursor) and (RestoreWaitCursor).
   
   
-
</pre>
+
'''Example:'''
-
== (EN) ==
+
  Print (BeginWaitCursor)
-
<pre>
+
  .
-
Mnemonic:  (EN)  
+
  .
-
Hex equivalent:  "@0E06@"  
+
  .
-
Discussion: Enter normal mode.  
+
Print (EndWaitCursor)
-
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.
+
== (Enhanced Mouse On) ==
   
   
-
Examplea. 100 FORMAT (EN);(SB);"CUSTOMER INQUIRY",@(10,0)
+
'''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)
   PRINT (0,100)
-
b. PRINT (0) (EN);(SB);"CUSTOMER INQUIRY",@(10,0)
+
'''Example b'''
 +
  PRINT (0) (Enhanced Mouse On
 +
 
 +
 
 +
 
 +
==[[Enhanced Printing]]==
 +
 
 +
Link to Enhanced Printing Summary
-
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. 
 
-
</pre>
 
== (ET) ==
== (ET) ==
-
<pre>
+
 
-
Mnemonic:  (ET)   
+
'''Mnemonic:'''   (ET)   
-
Hex equivalent:  "@0E05@"   
+
 
-
Discussion:  Enter typewriter mode.  
+
'''Hex equivalent:''' "@0E05@"  
-
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.  
+
   
 +
'''Discussion:''' Enter typewriter mode. <br>
 +
The (ET) control code sets the video display in typewriter mode.<br>
 +
Each new line of data written to the screen causes the screen to scroll up one line. <br>
 +
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).  
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).  
Line 208: Line 270:
The alternative to typewriter mode is normal mode.  
The alternative to typewriter mode is normal mode.  
   
   
-
Example:  a. 100 FORMAT (ET)
+
'''Example:  a.'''
 +
  100 FORMAT (ET)
   .
   .
   PRINT (0,100)
   PRINT (0,100)
Line 214: Line 277:
   INPUT (0) CUSTNUM$
   INPUT (0) CUSTNUM$
-
b. PRINT (0) (ET)
+
'''Example b.'''
 +
  PRINT (0) (ET)
   PRINT (0) "ENTER CUSTOMER NUMBER:"
   PRINT (0) "ENTER CUSTOMER NUMBER:"
   INPUT (0) CUSTNUM$
   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.
+
In this example, the screen is placed into typewriter mode. <br>
 +
Then a prompt is displayed and data is accepted into the variable named CUSTNUM$. <br>
 +
Items such as foreground, background and transmit marks are handled automatically.
-
</pre>
 
== (EraseFile) ==
== (EraseFile) ==
-
  <pre>
+
   
-
Mnemonic:  (EraseFile=file,flags)   
+
'''Mnemonic:''' (EraseFile=file,flags)  
-
Discussion:  The mnemonic erases a Windows file.  
+
   
 +
'''Discussion:''' The mnemonic erases a Windows file.  
 +
 
This mnemonic may be used by foreground programs only.  
This mnemonic may be used by foreground programs only.  
Line 231: Line 298:
Flags is the sum of the specified decimal values from the following chart:  
Flags is the sum of the specified decimal values from the following chart:  
-
Flag Description  
+
 
-
1 Perform function at CometAnywhere remote system
+
{| Border=1
-
2 If not CometAnywhere, then substitute local for remote
+
|Flag  
-
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.
+
|Description  
 +
|-
 +
|0
 +
|Perform function on the server, CometAnywhere or not.
 +
|-
 +
|1
 +
|Perform function on the client, CometAnywhere or not.
 +
|-
 +
|2
 +
|Perform function for CometAnywhere only and perform it on the client.  
 +
|-
 +
|}
   
   
-
After this mnemonic is issued, your program can issue an INPUT on LUN (0) to retrieve the error information. For example:  
+
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 2 & LOCAL AX$,DX$
Line 247: Line 327:
   Print (EraseFile=File$,Flags)
   Print (EraseFile=File$,Flags)
   Input (0,ResultFmt)
   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:  
+
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
   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
   DX$ = SUB(DX$,2,1) + SUB(DX$,1,1)  ! Flip the bytes around
   FuncError = HexDec(AX$)            ! Function error code (decimal)
   FuncError = HexDec(AX$)            ! Function error code (decimal)
   FileError = HexDec(DX$)            ! File error code (decimal)
   FileError = HexDec(DX$)            ! File error code (decimal)
-
 
+
.
   ! For unexpected values, convert to 2's complement signed integer
   ! For unexpected values, convert to 2's complement signed integer
   If (FuncError > 32767) FuncError = FuncError-65536
   If (FuncError > 32767) FuncError = FuncError-65536
Line 259: Line 340:
Here is a list of the function error codes in decimal form:  
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
 
 +
'''Error'''
 +
{| Border=1
 +
|(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:  
Here is a list of the suberror codes (common Windows file errors) in decimal form:  
-
Suberror
+
'''Suberror'''
-
(FileError) Description  
+
{| Border=1
-
0 Success  
+
|(FileError)
-
2 File not found  
+
| Description  
-
3 Path not found  
+
|-
-
5 Access denied  
+
|0
-
12 Invalid access  
+
| Success  
-
15 Invalid drive  
+
|-
-
16 An error has occurred in the current directory  
+
|2
-
18 No more files  
+
| File not found  
-
32 Sharing violation  
+
|-
-
33 Lock violation  
+
|3
-
80 File exists  
+
| Path not found  
-
161 Bad pathname  
+
|-
 +
|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 ==
   
   
-
History:  This mnemonic was added in Comet Build 299 and REL Version 01.07. 
+
'''Mnemonic:''' (ExecuteMetafile = FileName)   
-
</pre>
+
 
-
== Execute Metafile ==
+
'''Discussion:''' Executes the previously saved metafile FileName.
-
<pre>
+
-
Mnemonic:  (ExecuteMetafile = FileName)   
+
-
Discussion:  Executes the previously saved metafile FileName.
+
-
</pre>
+

Latest revision as of 17:58, 25 October 2011

Contents

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

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

(Enable Close)

Mnemonic: (EnableClose = Arg)

Where:

Arg = 0 – Disable [X] on main view window (If [X] is clicked the message: "Close has been disabled by the currently running program" will be displayed)

Arg = 1 – Enable [X] on main view window if disable count reaches 0 (see discussion below)

Arg = <anyothervalue> – Reset count and enable [X] on main view window

Discussion: Enables or disables the [X] close button at the top of a main Comet Window. Due to the possibility of nested programs calling this mnemonic, Comet will maintain a count of the number of “disables” issued. Only when the disable count reaches 0 will the close button be enabled. If a value other than 0 or 1 is issued then the disable count will be forced to 0 and the close button will be enabled. This mnemonic requires at minimum Comet build 451 and REL version 11.10.

Example:

 Print (EnableClose = 0)   ! Disable [X] button while processing
.
. ! Perform uninterrupted processing
.
 Print (EnableClose = 1)   ! Done - Enable [X] button

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

Example b

  PRINT (0) (Enhanced Mouse On


Enhanced Printing

Link to Enhanced Printing Summary

(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$

Example 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
0 Perform function on the server, CometAnywhere or not.
1 Perform function on the client, CometAnywhere or not.
2 Perform function for CometAnywhere only and perform it on the client.


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.

Personal tools