Loading and Unloading Tools

From CometWiki

(Difference between revisions)
Jump to: navigation, search
 
(3 intermediate revisions not shown)
Line 1: Line 1:
When you launch Comet98, a default tool context is loaded. These are the "initial tools" and they include a pop-up menu (File, Edit, View, and Help), four icons, and two accelerators (Ctrl+N and Ctrl+P).  
When you launch Comet98, a default tool context is loaded. These are the "initial tools" and they include a pop-up menu (File, Edit, View, and Help), four icons, and two accelerators (Ctrl+N and Ctrl+P).  
-
[[Image:Inittool.jpg]]
+
[[Image:Initialtools.jpg]]
'''The SNOVA Progam'''  
'''The SNOVA Progam'''  
Line 11: Line 11:
Comet will attempt to load a tool context named SYSTEM, which contains a popup structure with all of the Comet Utility programs and a toolbar with several popular utilities. The SYSTEM tool context looks like this:  
Comet will attempt to load a tool context named SYSTEM, which contains a popup structure with all of the Comet Utility programs and a toolbar with several popular utilities. The SYSTEM tool context looks like this:  
-
 
+
[[Image:Systemtools.jpg]]
   
   
Line 58: Line 58:
|-
|-
|L   
|L   
-
|Load a tool context and invoke the associated tools. Do not add this context to the tool stack.   
+
|Load a tool context and invoke the associated tools.  
 +
 
 +
Do not add this context to the tool stack.   
|ACTION$ = "L"
|ACTION$ = "L"
Line 69: Line 71:
   
   
|D   
|D   
-
|Destroy the current tool context. Restore the initial tools. Do not pop the tool stack. (This action does not require a tool context name.)   
+
|Destroy the current tool context.  
 +
 
 +
Restore the initial tools. Do not pop the tool stack.  
 +
 
 +
(This action does not require a tool context name.)   
|ACTION$ = "D"
|ACTION$ = "D"
Line 89: Line 95:
|-
|-
|O   
|O   
-
|Pop the top tool context from the stack and restore the previous tool context. If the stack is empty, or becomes empty as a result of this action, restore the initial tools. (This action does not require a tool context name.)   
+
|Pop the top tool context from the stack and restore the previous tool context.  
 +
 
 +
If the stack is empty, or becomes empty as a result of this action, restore the initial tools.  
 +
 
 +
(This action does not require a tool context name.)   
|ACTION$ = "O
|ACTION$ = "O
Line 98: Line 108:
|-  
|-  
|A   
|A   
-
|Pop all of the tool contexts from the tool stack. Restore the initial tools. (This action does not require a tool context name.)   
+
|Pop all of the tool contexts from the tool stack.  
 +
 
 +
Restore the initial tools. (This action does not require a tool context name.)   
|ACTION$ = "A"
|ACTION$ = "A"
Line 107: Line 119:
   
   
|I   
|I   
-
|Inquire. This action returns the name of the current tool context via the system buffer (in the sample program, the 6-byte field named CURRENT$ contains the name of the current tool context).   
+
|Inquire. This action returns the name of the current tool context via the system buffer  
 +
 
 +
(in the sample program, the 6-byte field named CURRENT$ contains the name of the current tool context).   
|ACTION$ = "I"
|ACTION$ = "I"
Line 115: Line 129:
INPUT (#) CURRENT$
INPUT (#) CURRENT$
-
 
PRINT (0) "Current tool:";CURRENT$
PRINT (0) "Current tool:";CURRENT$
|-
|-
|}
|}

Latest revision as of 23:43, 28 May 2009

When you launch Comet98, a default tool context is loaded. These are the "initial tools" and they include a pop-up menu (File, Edit, View, and Help), four icons, and two accelerators (Ctrl+N and Ctrl+P).

Initialtools.jpg

The SNOVA Progam

There are several ways to change the tool context. One way is to use the SNOVA program (found on the REL directory). This program is intended primarily for demonstration purposes, and operates as follows:


  • From the READY prompt, type SNOVA and press the Enter key.

Comet will attempt to load a tool context named SYSTEM, which contains a popup structure with all of the Comet Utility programs and a toolbar with several popular utilities. The SYSTEM tool context looks like this:

Systemtools.jpg


  • To load another tool context, type SNOVA followed by the name of the tool context. For example, if you have a tool context named SAMPLE, type the following:
  SNOVA SAMPLE

The CTOOL Program

Your MTB programs can change the tool context at any time by using a subprogram supplied by Signature Systems. This program is CTOOL (found on the REL directory).

The CTOOL subprogram provides several options. If you want to switch to a new tool context, you can either LOAD the context or PUSH it. The LOAD option does not affect the tool stack, while the PUSH option does. The PUSH option places the tool context name on the top of the tool stack and pushes any previous tool context names one level down on the stack.

There are three options for removing a tool context: DESTROY, POP, and POPALL. The DESTORY option does not affect the tool stack. The POP option removes the top tool context from the stack and retores the previous context. The POPALL option removes all of the tool contexts from the stack and restores the initial tools.

The INQUIRE option provides a way to determine the name of the current tool context.

The interface to the CTOOL program is very simple. It consists of two parameters:


  • an action code
  • the name of the tool context (as created with the CTMAINT program)

Your program should write these parameters to to the system buffer (in MTB terms, the LUN named #), then ENTER the CTOOL subprogram. The following program segment demonstrates the point.


LENGTH 1 & LOCAL ACTION$        ! action code is 1 character
LENGTH 6 & LOCAL TOOLFILE$      ! tool context is 6 characters max.
!
TOOL: FORMAT ACTION$;TOOLFILE$  ! format for the system buffer
!
ACTION$ = ___                   ! set the action code
TOOLFILE$ = _____________       ! specify the tool context name
PRINT (#,TOOL)                  ! write the info. to the buffer
ENTER "CTOOL"                   ! enter the CTOOL subprogram


Here are the action codes supported by the CTOOL program. In these examples, the example tool context is named SAMPLE and the assumed format statement label is named TOOL.

Action Code Description Program segement
L Load a tool context and invoke the associated tools.

Do not add this context to the tool stack.

ACTION$ = "L"

TOOLFILE$ = "SAMPLE"

PRINT (#,TOOL)

ENTER "CTOOL"

D Destroy the current tool context.

Restore the initial tools. Do not pop the tool stack.

(This action does not require a tool context name.)

ACTION$ = "D"

PRINT (#,TOOL)

ENTER "CTOOL"

P Push the specified tool context onto the tool stack and invoke the associated tools. ACTION$ = "P"

TOOLFILE$ = "SAMPLE"

PRINT (#,TOOL)

ENTER "CTOOL"

O Pop the top tool context from the stack and restore the previous tool context.

If the stack is empty, or becomes empty as a result of this action, restore the initial tools.

(This action does not require a tool context name.)

ACTION$ = "O

PRINT (#,TOOL)

ENTER "CTOOL"

A Pop all of the tool contexts from the tool stack.

Restore the initial tools. (This action does not require a tool context name.)

ACTION$ = "A"

PRINT (#,TOOL)

ENTER "CTOOL"

I Inquire. This action returns the name of the current tool context via the system buffer

(in the sample program, the 6-byte field named CURRENT$ contains the name of the current tool context).

ACTION$ = "I"

PRINT (#,TOOL)

ENTER "CTOOL"

INPUT (#) CURRENT$

PRINT (0) "Current tool:";CURRENT$

Personal tools