Category : C Source Code
Archive   : JJBQC.ZIP
Filename : JJBSHOW4.C

 
Output of file : JJBSHOW4.C contained in archive : JJBQC.ZIP




/**************************************************************************
* *
* JJBSHOW4.C *
* *
* Copyright (c) 1989, JJB. All rights reserved. *
* *
* The purpose of JJB is to help you to write programs as quickly *
* as possible. JJB handles things for you and provides you with *
* an environment which allows you to concentrate on the functions *
* of your program. *
* *
* This example shows you how to use the following functions: *
* *
* jjb_initalize() initalizes JJB. *
* jjb_setup() sets up the JJB option arrays. *
* jjb_start() begins executing the default option. *
* *
* group(group description) start setting up a group of options & *
* assign a description to the group. *
* *
* option(option description) sets up an option. *
* *
* funct(function name) assigned a function to the option. *
* default_opt() assigns default to an option *
* help(functionname) assigns a function to F1 help. *
* *
* *
* If you are looking at this file from DOS, you need to first read *
* JJBREAD.ME file and follow the instructions. *
* *
* You may now press 'F5' to compile and begin executing. *
* *
* JJB, 9236 church Rd suite 1082, Dallas, Tx 75231 (214) 341-1635 *
**************************************************************************/

/***************************************************************************
* *
* To make an .exe file JJBSHOW4.EXE for this program, from DOS enter: *
* *
* QCL /c /AM JJBSHOW4.C *
* LINK JJBSHOW4.OBJ + JJB.OBJ + JJBINPUT.OBJ,,, C:LIB\, *
* *
***************************************************************************/

#include "c:\bin\jjbkbd.h"
#include "c:\bin\jjbset.h"


main() {

jjb_initalize(); /* initalize JJB arrays and video screen */

jjb_setup(); /* set up the options */

jjb_start(); /* start executing the default option */

}



/****************************************************************************
* *
* sample_function() *
* *
* This is a sample function which is assigned to the options *
* to show you how functions can be executed when you select *
* an option. *
* *
* if you do not assign a function to each option, JJB will initalize *
* *
* each option with a null function which just gets a character. *
* *
****************************************************************************/


/* Below is just a sample of some of the video fast 'vf' functions */
/* you will be able to use in the JJB hidden library, see JJBREAD.ME */

/* 'vfs(string)' video fast a string direct to video memory. */
/* 'vfscr(string,2,14)' sets up all subsequent 'vfscr' for down 2 over 14 */
/* 'vfscr(string)' does 2 carr. rets and goes over to column 14 */
/* All the 'vf' functions are portable and work for all video controllers */
/* vfs(string does not affect cursor. 'vfsc(string)' places cursor after */

/* The complete set of 'vf' functions are explained in the */
/* written documentation from JJB. */


sample_help() {
vsave_screen(); /* save the screen */
vclr_screen(); /* clear the screen */
vloc(6,14); /* position for video fast functions */

/* 'vfscr(' videos fast a string and then does a carriage ret.
'2,14' sets up all subsequent to come down two and over 14. */

vfscr("F1 is reserved for help.",2,14);

vfscr("You can set up a function and call it by using the F1 key.");
vfscr("JJB will use whatever function you assign in jjb_setup().");
vfscr("In this example, jjb_setup assigns sample_help() as follows:");
vfscr(" 'help(sample_help);'",3);
vfsc( pak() ); /* video fast 'Press any key'and put cursor after */
getch(); /* getch() is ok here. */
vrest_screen(); /* restore the screen */
}

sample_function() { char str[31]; char *sp = " ";

vloc(4,8); /* prepare for a video fast at row 4, column 8 */
vfscr("Look at the file JJBSHOW4.C to see how JJB works.",2,8);
vfscr("JJB may be used for any programming application.");
vfs("JJB LA (Large Application)");
vfscr(" is to be released in the spring of 1989.",3,8);
vfscr("At any time while typing, you may press ALT and change options.",2,8);
vfscr("The option selected is displayed in bottom left corner.");

while (1)
{
/* see JJBSHOW5.C for an example of how you can use the enter */
/* functions to input entire screens of data. */

enter(16,20,"Enter a string ",&str[0],30);
enter(18,20,"Press any key ",&str[0],1);

vloc(18,20); vspaces(55); /* clear press any key. */


}
}


/****************************************************************************
* *
* jjb_setup() *
* *
* jjb_setup() is where you set up all your program option descriptions *
* and assign function names to each option. *
* *
****************************************************************************/

/* The groups and options descriptions being set up have no meaning. */
/* Any description can be chosen. */
/* Try changing them and see what happens when you press 'F5'. */
/* Some of the options below do not have a function assigned to them. */
/* To keep this example simple, more than one function is assigned to */
/* the sample function. Normally, you would not assign a function */
/* to more than one option. */
/* */

jjb_setup() {

group("Application"); /* this starts a group of options */

option("Applications Test #1");
funct(sample_function);
option("Applications 'V'ideo Test");
funct(sample_function);

option("Applications 'D'isk Test");
funct(sample_function);
default_opt(); /* start with this option */

option("C'o'mmunicatyion Test");
funct(sample_function);


group("Reports"); /* this starts a group of options */

option("General ledger F7"); /* assign F7 to this option */
option("Trial Balance");
funct(sample_function);
option("Chart of Accounts Report");
funct(sample_function);
option("Profit & Loss");
funct(sample_function);
option("Balance Sheet",DRAWLINE); /* DRAWLINE separates */
funct(sample_function);
option("More Reports");
funct(sample_function);

group("More");
option("Miscellaneous Options");
option("Month-end Closing");

help(sample_help);

}




  3 Responses to “Category : C Source Code
Archive   : JJBQC.ZIP
Filename : JJBSHOW4.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/