home *** CD-ROM | disk | FTP | other *** search
- Copyright (c) 1992-1993 SAS Institute, Inc, Cary, NC, USA
- All Rights Reserved
-
- SAS/C Background Examples
-
- - Open Window Example
- - Help System Hot-Key Example
-
- version 6.50 1993
-
- ****************************************************************************
- There are two examples included here which demonstrate the use of the
- cback.o startup module.
-
- The first, back.c, is a program which demonstrates how to write a simple
- background process. This program opens a window and writes a message. You
- may close the CLI from which it was run before closing the window opened by
- back.c.
-
- The second, schelp.c, is a program which demonstrates how to write a
- background process which employs a hot-key. This program will pop up the
- main interface to the SAS/C Help System whenever control-Help is pressed.
- You may want to compile it and place a call to it in your startup sequence
- for general use.
-
-
- Double click on the Build Icon to build both of these examples.
-
- *************************** back.c ****************************
-
- You should compile this program with the following options:
-
- STRUCTUREEQUIVALENCE
- LINK
- STARTUP=cback
-
-
- STRUCTUREEQUIVALENCE is not required, but it does circumvent several
- warnings that would otherwise be produced.
-
- STARTUP=cback tells slink to link with the background startup code. This
- is required to produce a background process. If you link in a separate step,
- you must link with cback.o instead of c.o.
-
- *** IMPORTANT ** You must remember when writing a background process not to
- call printf() or other standard IO functions. If you do, you will probably
- crash the machine.
-
- You may notice that this program does not open any AmigaDOS libraries. Instead
- it takes advantage of the fact that the Version 6 development system opens
- needed AmigaDOS libraries for you.
-
-
-
- ************************* schelp.c **************************
-
- You should compile schelp.c with the following options:
-
- NOSTACKCHECK
- STRUCTUREEQUIVALENCE
- LINK
- STARTUP=cback
-
- NOSTACKCHECK is suggested because the function handlerStuff can be called
- from a task other than this program. It would be required if the function
- was not declared with the __interrupt keyword. This is discussed in more
- detail at the function's definition.
-
- STRUCTUREEQUIVALENCE is not required, but it does circumvent several
- warnings that would otherwise be produced.
-
- STARTUP=cback tells slink to link with the background startup code. This
- is required to produce a background process. If you link in a separate step,
- you must link with cback.o instead of c.o.
-
- You may notice that this program does not open any AmigaDOS libraries. Instead
- it takes advantage of the fact that the Version 6 development system opens
- needed libraries for you.
-
- **** IMPORTANT ***
- When running CPR on this program or other programs using __main, you
- must perform the following 2 steps to avoid crashing the machine:
-
- 1) As soon as cpr is invoked, select Catch New Tasks from the
- Options menu. Catch New Tasks must be set to on.
-
- 2) Type
- go __main
-
- This places you at the beginning of your code. If you say
- go __main without setting Catch New Tasks to on, you will
- probably crash the machine.
-
- If you try to debug the input handler program HandlerInterface in this
- program, you will probably crash your machine.
-
- The "schelp" command takes the following forms:
-
- schelp
-
- This command will load schelp as a background process, display a copyright
- banner, and display the usage information. If schelp is already loaded,
- it will simply display the usage information.
-
- schelp quit
-
- This command will display a terminating message and unload schelp from
- memory.
-
- schelp <command>
-
- This command will replace the command currently tied to the control-Help
- key with the command designated. In order for the command to work, it
- must contain the full path to the command. The default command is
-
- sc:c/amigaguide sc:help/sc_help.guide
-
-