home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Guide / c-cplusplus-interactive-guide.iso / c_ref / csource4 / 291_01 / jjbshow4.c < prev    next >
Text File  |  1989-06-28  |  13KB  |  248 lines

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *                           JJBSHOW4.C                                   *
  4.  *                                                                        *
  5.  *   Copyright (c) 1988, 1989, JJB. All rights reserved.                  *
  6.  *                                                                        *
  7.  *   The purpose of JJB is to help you to write programs as quickly       *
  8.  *   as possible. JJB handles things for you and provides you with        *
  9.  *   an environment which allows you to concentrate on the functions      *
  10.  *   of your program.                                                     *
  11.  *                                                                        *
  12.  *   This example shows you how to use the following functions:           *
  13.  *                                                                        *
  14.  *      jjb_initalize()            initalizes JJB.                        *
  15.  *      jjb_setup()                sets up the JJB option arrays.         *
  16.  *      jjb_start()                begins executing the default option.   *
  17.  *                                                                        *
  18.  *      group(group description)   start setting up a group of options &  *
  19.  *                                  assign a description to the group.    *
  20.  *                                                                        *
  21.  *      option(option description) sets up an option.                     *
  22.  *                                                                        *
  23.  *      funct(function name)       assigned a function to the option.     *
  24.  *      default_opt()              assigns default to an option           *
  25.  *      help(functionname)        assigns a function to F1 help.          *
  26.  *                                                                        *
  27.  *    Turbo C is a trademark of Borland International, Inc.               *
  28.  *    Quick C is a trademark of Microsoft Corp.                           *
  29.  *    JJB, 9236 church Rd suite 1082, Dallas, Tx 75231 (214) 341-1635     *
  30.  **************************************************************************/
  31.  
  32.  
  33. /***************************************************************************
  34.  * For Turbo C programmers only:                                           *
  35.  *   To run this program from DOS:                                         *
  36.  *                                                                         *
  37.  *         Enter 'TC JJBSHOW4'    ( to load this file with Turbo C)        *
  38.  *         Press 'CTRL F9'        ( to compile and begin executing)        *
  39.  *                                                                         *
  40.  ***************************************************************************/
  41.  
  42. /***************************************************************************
  43.  * for Quick C programmers only:                                           *
  44.  *   To run this program, from DOS:                                        *
  45.  *                                                                         *
  46.  *         Enter 'JJBQCS4'    ( to load this file with JJB.QLB)            *
  47.  *         Press 'F5'         ( to compile and begin executing)            *
  48.  *                                                                         *
  49.  *   To make the .exe file JJBSHOW4.EXE, from DOS enter:                   *
  50.  *         QCL  /c  /AM  JJBSHOW4.C                                        *
  51.  *         LINK  JJBSHOW4.OBJ + JJBQC.OBJ + JJBQCINP.OBJ ,,, C:LIB\,       *
  52.  *                                                                         *
  53.  ***************************************************************************/
  54.  
  55. /***************************************************************************
  56.  *                                                                         *
  57.  * for both TURBO C and QUICK C programmers:                               *
  58.  *                                                                         *
  59.  * Not all options have been assigned functions. The options unassigned    *
  60.  * execute the JJB copyright function.                                     *
  61.  *                                                                         *
  62.  * As JJB executes (runs) a program, the following keys can be pressed:    *
  63.  *                                                                         *
  64.  *    ALT X     to exit.                                                   *
  65.  *    F1        to display a help screen.                                  *
  66.  *    F2-F9     to instantly select another option.                        *
  67.  *    ALT       to select a group of options.                              *
  68.  *    ALT       and a letter to select a specific group.                   *
  69.  *    ESC       means nevermind.                                           *
  70.  *       ->        to select the group to the right.                       *
  71.  *       <-        to select the group to the left.                        *
  72.  *       UPARROW   to highlight the option above.                          *
  73.  *       DOWNARROW to highlight the option below.                          *
  74.  *       RETURN    to select the option highlighted.                       *
  75.  *       A LETTER  to select a specific option.                            *
  76.  *       ALT and a letter to select a different group.                     *
  77.  *       ESC       return exactly where you were in the function           *
  78.  *                      currently being executed.                          *
  79.  *                                                                         *
  80.  * If another option is selected, JJB will execute:                        *
  81.  *                                                                         *
  82.  *         the leave function for the current option.                      *
  83.  *         the leave function for the current group.                       *
  84.  *         the initalization function for the selected group.              *
  85.  *         the initalization function for the selected option.             *
  86.  *         and option function.                                            *
  87.  *                                                                         *
  88.  ***************************************************************************/
  89.  
  90. /* see JJB-READ.DOC for an additional explanation of the functions below.  */
  91.  
  92. #include <jjbkbd.h>
  93. #include <jjbset.h>
  94.  
  95. main() {
  96.  
  97.   jjb_initalize();      /* initalize JJB arrays and video screen */
  98.  
  99.   jjb_setup();          /* set up the options */
  100.  
  101.   jjb_start();          /* start executing the default option   */
  102.  
  103.   }
  104.  
  105.  
  106. /****************************************************************************
  107.  *                                                                          *
  108.  *                        sample_function()                                 *
  109.  *                                                                          *
  110.  *   This is a sample function which is assigned to the options             *
  111.  *   to show you how functions can be executed when you select              *
  112.  *   an option.                                                             *
  113.  *                                                                          *
  114.  *   if you do not assign a function to each option, JJB will initalize     *
  115.  *                                                                          *
  116.  *   each option with a null function which just gets a character.          *
  117.  *                                                                          *
  118.  ****************************************************************************/
  119.  
  120.  
  121. /* Below is just a sample of some of the video fast 'vf' functions          */
  122. /*   you will be able to use in the JJB library, see JJBREAD.ME             */
  123.  
  124. /* 'vfs(string)'         video fast a string direct to video memory.        */
  125. /* 'vfsdo(string,2,14)'  sets up all subseq