home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6571.LZX / examples / cback / READ.ME < prev    next >
Encoding:
Text File  |  1996-12-24  |  4.3 KB  |  119 lines

  1. Copyright (c) 1992-1993 SAS Institute, Inc, Cary, NC, USA
  2. All Rights Reserved
  3.  
  4.                            SAS/C Background Examples
  5.  
  6.                         - Open Window Example
  7.                         - Help System Hot-Key Example
  8.  
  9.                             version 6.50   1993
  10.  
  11. ****************************************************************************
  12. There are two examples included here which demonstrate the use of the
  13. cback.o startup module.  
  14.  
  15. The first, back.c, is a program which demonstrates how to write a simple
  16. background process.  This program opens a window and writes a message.  You
  17. may close the CLI from which it was run before closing the window opened by
  18. back.c.
  19.  
  20. The second, schelp.c, is a program which demonstrates how to write a
  21. background process which employs a hot-key.  This program will pop up the
  22. main interface to the SAS/C Help System whenever control-Help is pressed.
  23. You may want to compile it and place a call to it in your startup sequence
  24. for general use.
  25.  
  26.  
  27. Double click on the Build Icon to build both of these examples.
  28.  
  29.        *************************** back.c ****************************
  30.  
  31. You should compile this program with the following options:
  32.  
  33.        STRUCTUREEQUIVALENCE
  34.        LINK
  35.        STARTUP=cback
  36.  
  37.  
  38. STRUCTUREEQUIVALENCE is not required, but it does circumvent several
  39. warnings that would otherwise be produced.
  40.  
  41. STARTUP=cback tells slink to link with the background startup code.  This
  42. is required to produce a background process.  If you link in a separate step,
  43. you must link with cback.o instead of c.o.
  44.  
  45. *** IMPORTANT **  You must remember when writing a background process not to 
  46. call printf() or other standard IO functions.  If you do, you will probably
  47. crash the machine.
  48.  
  49. You may notice that this program does not open any AmigaDOS libraries.  Instead
  50. it takes advantage of the fact that the Version 6 development system opens
  51. needed AmigaDOS libraries for you.
  52.  
  53.  
  54.  
  55.        ************************* schelp.c **************************
  56.  
  57. You should compile schelp.c with the following options:
  58.  
  59.                NOSTACKCHECK
  60.                STRUCTUREEQUIVALENCE
  61.                LINK
  62.                STARTUP=cback
  63.  
  64. NOSTACKCHECK is suggested because the function handlerStuff can be called
  65. from a task other than this program.  It would be required if the function
  66. was not declared with the __interrupt keyword.  This is discussed in more
  67. detail at the function's definition.
  68.  
  69. STRUCTUREEQUIVALENCE is not required, but it does circumvent several
  70. warnings that would otherwise be produced.
  71.  
  72. STARTUP=cback tells slink to link with the background startup code.  This
  73. is required to produce a background process.  If you link in a separate step,
  74. you must link with cback.o instead of c.o.
  75.  
  76. You may notice that this program does not open any AmigaDOS libraries.  Instead
  77. it takes advantage of the fact that the Version 6 development system opens
  78. needed libraries for you.
  79.  
  80. ****  IMPORTANT  ***
  81. When running CPR on this program or other programs using __main, you
  82. must perform the following 2 steps to avoid crashing the machine:
  83.  
  84.        1)  As soon as cpr is invoked, select Catch New Tasks from the
  85.            Options menu.  Catch New Tasks must be set to on.
  86.            
  87.        2)  Type 
  88.                 go __main
  89.                 
  90.            This places you at the beginning of your code.  If you say
  91.            go __main without setting Catch New Tasks to on, you will
  92.            probably crash the machine.  
  93.            
  94. If you try to debug the input handler program HandlerInterface in this
  95. program, you will probably crash your machine.           
  96.  
  97. The "schelp" command takes the following forms:
  98.  
  99.                              schelp
  100.  
  101. This command will load schelp as a background process, display a copyright
  102. banner, and display the usage information.  If schelp is already loaded,
  103. it will simply display the usage information.
  104.  
  105.                              schelp quit
  106.              
  107. This command will display a terminating message and unload schelp from
  108. memory.            
  109.  
  110.                              schelp <command>
  111.              
  112. This command will replace the command currently tied to the control-Help
  113. key with the command designated.  In order for the command to work, it 
  114. must contain the full path to the command.  The default command is
  115.     
  116.                  sc:c/amigaguide sc:help/sc_help.guide            
  117.  
  118.