home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 281_01 / tdata.c < prev    next >
C/C++ Source or Header  |  1988-10-06  |  18KB  |  637 lines

  1. /*  tdata.c
  2.  *
  3.  *  Test program for data entry functions
  4.  *
  5.  */
  6.  
  7.  
  8. /*
  9.  *  This program demonstrates some of the data entry functions contained
  10.  *  in the Unicorn Library.  While the author intends to add many more
  11.  *  functions and a much broader capability to the library this early
  12.  *  version is being released.    Planned for a future release is a form
  13.  *  design utility that will allow easy field definitions.  This utility
  14.  *  should be able to take an ASCII description file and write the C
  15.  *  code for the fields.  This should save considerable time in form
  16.  *  development.  At present this is in the early planning stages so
  17.  *  no final release date has been set.
  18.  *
  19.  */
  20.  
  21.  
  22.  
  23. #include <stdio.h>
  24.  
  25. #include "uc_defs.h"
  26. #include "uc_glob.h"
  27.  
  28. #include "wn_defs.h"
  29. #include "wn_glob.h"
  30.  
  31. WINDOWPTR  fmp;
  32. WINDOWPTR  wn1;
  33. WINDOWPTR  wn_main;
  34. WINDOWPTR  wn_title;
  35. WINDOWPTR  wn_make();
  36. char       *strblnk();
  37. FIELDPTR   fld_make();
  38. char       *str_save();
  39. FIELDPTR   fld[ 8 ];
  40.  
  41.  
  42. void main( void )
  43. {
  44.    int      i;
  45.  
  46.    char   *rec;
  47.    char   *rec_mask;
  48.  
  49.    char   *fname;
  50.    char   *f_mask;
  51.  
  52.    char   *lname;
  53.    char   *l_mask;
  54.  
  55.    char   *addr;
  56.    char   *ad_mask;
  57.  
  58.    char   *city;
  59.    char   *c_mask;
  60.  
  61.    char   *state;
  62.    char   *s_mask;
  63.  
  64.    char   *zip;
  65.    char   *z_mask;
  66.  
  67.    char   *phone;
  68.    char   *p_mask;
  69.  
  70.    char   *birthday;
  71.    char   *b_mask;
  72.  
  73.    char   *amount;
  74.    char   *a_mask;
  75.  
  76.    int      before6();
  77.    int      after6();
  78.    int      on_key();
  79.    int      val_state();
  80.    int      val_date();
  81.  
  82.  
  83.    char   *xx;
  84.  
  85.                 /*    Save the users original cursor status */
  86.    cur_save();
  87.  
  88.  
  89.                 /*    This function inititalizes the system */
  90.    uc_init();
  91.    if ( mouse_exist )
  92.       m_flagdec();
  93.                 /*    This window is built as a full screen */
  94.                 /*    window to save the users original     */
  95.                 /*    screen.  Bringing this window down at */
  96.                 /*    the end of the demo the screen will be*/
  97.                 /*    restored to its original state.       */
  98.  
  99.    wn_main = wn_make( 0, 0, 24, 80 );
  100.    wn_wnclr( wn_main, mk_att( BLACK, CYAN + BRIGHT ) );
  101.    wn_bclr( wn_main, mk_att( BLACK, BROWN + BRIGHT ) );
  102.    wn_clear( wn_main );
  103.    wn_margin( wn_main, 5 );
  104.    wn_mkbdr( wn_main, BDR_SLNP );
  105.  
  106.    wn_dsply( wn_main );
  107.  
  108.  
  109.  
  110.            /* Make a window for display of the Unicorn Software   */
  111.            /* address and phone number.  The phone is the authors */
  112.            /* home phone.  Call after 6pm Pacific time on          */
  113.            /* weeknights please.  The author must moonlight for   */
  114.            /* about 40 hours a week as a software engineer in     */
  115.            /* order to support this shareware hobby.          */
  116.  
  117.    wn_title = wn_make( 0, 0, 7, 80 );
  118.    wn_wnclr( wn_title, mk_att( BLACK, BROWN + BRIGHT ) );
  119.    wn_bclr( wn_title, mk_att( BLACK, BROWN + BRIGHT ) );
  120.    wn_clear( wn_title );
  121.  
  122.    wn_mkbdr( wn_title, BDR_SLNP );
  123.  
  124.    wn_dsply( wn_title );
  125.  
  126.    wn_printf( wn_title, "\t\t\t\t\t         Unicorn Software\n" );
  127.    wn_printf( wn_title, "\t\t\t\t\tP.O Box 3214 Kirkland, WA 98083-3214\n" );
  128.    wn_printf( wn_title, "\t\t\t\t\t         ( 206 ) 823-4656\n" );
  129.    wn_wnclr( wn_title, mk_att( BLACK, MAGENTA + BRIGHT ) );
  130.    wn_printf( wn_title, "\t\t\t\t\t      No collect calls Please" );
  131.  
  132.  
  133.                /*  This was inititalized in the uc_init   */
  134.                /*  call but then a window ( wn_main ) was */
  135.                /*  placed on top of it so now we must move*/
  136.                /* it to the front.                  */
  137.    wn_front( wnd_message );
  138.  
  139.  
  140.  
  141.                 /* Now we will define the data form and   */
  142.                 /* start attaching fields to the window   */
  143.  
  144.    fmp = wn_make( 5, 0, 14, 80 );
  145.    wn_wnclr( fmp, mk_att( BLUE, CYAN + BRIGHT ) );
  146.    wn_bclr( fmp, mk_att( BLUE, BROWN + BRIGHT ) );
  147.    wn_clear( fmp );
  148.  
  149.    wn_mkbdr( fmp, BDR_DLNP );
  150.  
  151.    wn_printf( fmp,
  152.     "                Unicorn Software Data Entry System 1.00" );
  153.    wn_printf( fmp, "\n\n\n\n\n\n\n\n\n\n\n" );
  154.    wn_printf( fmp,
  155.     "                Press F1 for help  -  ESC to leave form" );
  156.  
  157.                   /* display the form on the screen       */
  158.    wn_dsply( fmp );
  159.  
  160.                   /* prepare to add data fields to window */
  161.    fld_init( fmp );
  162.  
  163.  
  164.  
  165.                   /* This is the first field          */
  166.    rec        = strblnk( 8 );
  167.    rec_mask = strblnk( 8 );
  168.  
  169.    strcpy( rec,       "    " );
  170.    strcpy( rec_mask,  "9999" );
  171.  
  172.    fld[ 0 ] = fld_make( fmp, 2, 5, "Record Number ", 19,
  173.                      rec_mask, rec, FLD_ZERO_FILL );
  174.    if ( fld[ 0 ] == ( FIELDPTR ) NULL )
  175.    {
  176.       fld_err( str_save( "Out of memory for field 0" ) );
  177.       exit( 1 );
  178.    }
  179.    xx = str_save( "Enter the current record number for this person" );
  180.    sf_message( fld[ 0 ], xx );
  181.    xx = str_save( "The record number must be an integer" );
  182.    sf_hlptag( fld[ 0 ], xx );
  183.                 /* The helptag parameter is currently */
  184.                 /* nothing more than a message.  In a */
  185.                 /* later release it will become a true*/
  186.                 /* help tag that may be used to find  */
  187.                 /* the help message in an ASCII text  */
  188.                 /* file.  The user will then be able  */
  189.                 /* to scroll this file in the help    */
  190.                 /* window.  This will allow the       */
  191.                 /* creation of a full capability help */
  192.                 /* system that is context sensitive.  */
  193.  
  194.  
  195.    fname    = strblnk( 18 );
  196.    f_mask   = strblnk( 18 );
  197.  
  198.    strcpy( fname,   "               " );
  199.    strcpy( f_mask,  "!AAAAAAAAAAAAAA" );
  200.  
  201.    fld[ 1 ] = fld_make( fmp, 3, 5, "First Name    ", 19,
  202.                     f_mask, fname, FLD_ALPHA_NUMERIC );
  203.    if ( fld[ 1 ] == ( FIELDPTR ) NULL )
  204.    {
  205.       fld_err( str_save( "Out of memory for field 1" ) );
  206.       exit( 1 );
  207.    }
  208.    xx = str_save( "Enter the first name only ( no middle initial )" );
  209.    sf_message( fld[ 1 ], xx );
  210.    xx = str_save( "Enter the full legal first name" );
  211.    sf_hlptag( fld[ 1 ], xx );
  212.  
  213.  
  214.  
  215.  
  216.  
  217.    lname    = strblnk( 18 );
  218.    l_mask   = strblnk( 18 );
  219.  
  220.    strcpy( lname,   "Miller         " );
  221.    strcpy( l_mask,  "!AAAAAAAAAAAAAA" );
  222.  
  223.    fld[ 2 ] = fld_make( fmp, 4, 5, "Last Name     ", 19,
  224.                      l_mask, lname, FLD_ALPHA_NUMERIC );
  225.    if ( fld[ 2 ] == ( FIELDPTR ) NULL )
  226.    {
  227.       fld_err( str_save( "Out of memory for field 2" ) );
  228.       exit( 1 );
  229.    }
  230.    xx = str_save( "Enter the last name for this person" );
  231.    sf_message( fld[ 2 ], xx );
  232.    xx = str_save( "Enter the full legal last name" );
  233.    sf_hlptag( fld[ 2 ], xx );
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.    addr     = strblnk( 28 );
  241.    ad_mask  = strblnk( 28 );
  242.  
  243.    strcpy( addr,     "                     " );
  244.    strcpy( ad_mask,  "XXXXXXXXXXXXXXXXXXXXX" );
  245.  
  246.    fld[ 3 ] = fld_make( fmp, 5, 5, "Address       ", 19,
  247.                      ad_mask, addr, FLD_ALPHA_NUMERIC );
  248.    if ( fld[ 3 ] == ( FIELDPTR ) NULL )
  249.    {
  250.       fld_err( str_save( "Out of memory for field 3" ) );
  251.       exit( 1 );
  252.    }
  253.    xx = str_save( "Enter the full street address" );
  254.    sf_message( fld[ 3 ], xx );
  255.    xx = str_save( "Include apartment number if needed" );
  256.    sf_hlptag( fld[ 3 ], xx );
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.    city     = strblnk( 18 );
  265.    c_mask   = strblnk( 18 );
  266.  
  267.    strcpy( city,     "                " );
  268.    strcpy( c_mask,   "!AAAAAAAAAAAAAAA" );
  269.  
  270.    fld[ 4 ] = fld_make( fmp, 6, 5, "City          ", 19,
  271.                      c_mask, city, FLD_ALPHA_NUMERIC );
  272.    if ( fld[ 4 ] == ( FIELDPTR ) NULL )
  273.    {
  274.       fld_err( str_save( "Out of memory for field 4" ) );
  275.       exit( 1 );
  276.    }
  277.    xx = str_save( "Enter this person's city of residence" );
  278.    sf_message( fld[ 4 ], xx );
  279.    xx = str_save( "This must be the city of legal residence" );
  280.    sf_hlptag( fld[ 4 ], xx );
  281.  
  282.  
  283.  
  284.  
  285.    state    = strblnk( 4 );
  286.    s_mask   = strblnk( 4 );
  287.  
  288.    strcpy( state,    "  " );
  289.    strcpy( s_mask,   "!!" );
  290.  
  291.    fld[ 5 ] = fld_make( fmp, 6, 42, "State ", 50,
  292.                      s_mask, state, FLD_ALPHA_NUMERIC );
  293.    if ( fld[ 5 ] == ( FIELDPTR ) NULL )
  294.    {
  295.       fld_err( str_save( "Out of memory for field 5" ) );
  296.       exit( 1 );
  297.    }
  298.    xx = str_save( "Enter the state of residence" );
  299.    sf_message( fld[ 5 ], xx );
  300.    xx = str_save( "Use proper postal abbreviations only" );
  301.    sf_hlptag( fld[ 5 ], xx );
  302.    sf_val( fld[ 5 ], val_state );
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.    zip        = strblnk( 8 );
  310.    z_mask   = strblnk( 8 );
  311.  
  312.    strcpy( zip,      "     " );
  313.    strcpy( z_mask,   "99999" );
  314.  
  315.    fld[ 6 ] = fld_make( fmp, 6, 55, "Zip Code", 64,
  316.                      z_mask, zip, FLD_ALPHA_NUMERIC );
  317.    if ( fld[ 6 ] == ( FIELDPTR ) NULL )
  318.    {
  319.       fld_err( str_save( "Out of memory for field 6" ) );
  320.       exit( 1 );
  321.    }
  322.    xx = str_save( "Enter the five digit zip code" );
  323.    sf_message( fld[ 6 ], xx );
  324.    xx = str_save( "This field does not include the extended zip code" );
  325.    sf_hlptag( fld[ 6 ], xx );
  326.  
  327.    sf_begfunc( fld[ 6 ], before6 );
  328.    sf_endfunc( fld[ 6 ], after6  );
  329.  
  330.  
  331.  
  332.  
  333.    phone    = strblnk( 16 );
  334.    p_mask   = strblnk( 16 );
  335.  
  336.    strcpy( phone,    "          " );
  337.    strcpy( p_mask,   "(999) 999-9999" );
  338.  
  339.    fld[ 7 ] = fld_make( fmp, 7, 5, "Phone         ", 19,
  340.                      p_mask, phone, FLD_ALPHA_NUMERIC );
  341.    if ( fld[ 7 ] == ( FIELDPTR ) NULL )
  342.    {
  343.       fld_err( str_save( "Out of memory for field 7" ) );
  344.       exit( 1 );
  345.    }
  346.    xx = str_save( "Enter the home phone for this person" );
  347.    sf_message( fld[ 7 ], xx );
  348.    xx = str_save( "Include the area code for this phone number" );
  349.    sf_hlptag( fld[ 7 ], xx );
  350.  
  351.  
  352.  
  353.  
  354.  
  355.    birthday = strblnk( 10 );
  356.    b_mask   = strblnk( 10 );
  357.  
  358.    strcpy( birthday, "        " );
  359.    strcpy( b_mask,   "99/99/99" );
  360.  
  361.    fld[ 8 ] = fld_make( fmp, 7, 55, "Birthday", 64,
  362.                      b_mask, birthday, FLD_ALPHA_NUMERIC );
  363.    if ( fld[ 8 ] == ( FIELDPTR ) NULL )
  364.    {
  365.       fld_err( str_save( "Out of memory for field 8" ) );
  366.       exit( 1 );
  367.    }
  368.    xx = str_save( "Enter the birthdate for this person in mm/dd/yy format" );
  369.    sf_message( fld[ 8 ], xx );
  370.    xx = str_save( "Use only two digits for the year" );
  371.    sf_hlptag( fld[ 8 ], xx );
  372.    sf_val( fld[ 8 ], val_date );
  373.  
  374.  
  375.  
  376.    amount   = strblnk( 8 );
  377.    a_mask   = strblnk( 8 );
  378.  
  379.  
  380.               /* This field is justified.  The actual     */
  381.               /* data string must NOT include space for   */
  382.               /* the mask characters or the justification */
  383.               /* routine will shove the data out of view  */
  384.               /* to the right.  Trust me!              */
  385.    strcpy( amount,   "      " );
  386.    strcpy( a_mask,   "$9999.99" );
  387.  
  388.    fld[ 9 ] = fld_make( fmp, 9, 25, "Balance   ", 36,
  389.                      a_mask, amount, FLD_MONEY );
  390.    if ( fld[ 9 ] == ( FIELDPTR ) NULL )
  391.    {
  392.       fld_err( str_save( "Out of memory for field 9" ) );
  393.       exit( 1 );
  394.    }
  395.    xx = str_save( "Enter the this person's current account balance" );
  396.    sf_message( fld[ 9 ], xx );
  397.    xx = str_save( "Deduct any current payments" );
  398.    sf_hlptag( fld[ 9 ], xx );
  399.  
  400.  
  401.                  /* This loop will set all the field  */
  402.                  /* attributes, Active, Inactive and  */
  403.                  /* prompt.                  */
  404.    for ( i = 0; i <= 9; i ++ )
  405.    {
  406.       sf_active( fld[ i ], mk_att( RED, BROWN + BRIGHT ) );
  407.       sf_inactive( fld[ i ], mk_att( RED, WHITE ) );
  408.       sf_patt( fld[ i ], mk_att( BLUE, BROWN + BRIGHT ) );
  409.    }
  410.  
  411.  
  412.                /* Clear the form.  It is possible to      */
  413.                /* preassign data to the fields by placing */
  414.                /* the data in the string when using the   */
  415.                /* strblnk function ( see last name field )*/
  416.                /* above.  Without the fm_clear this would */
  417.                /* appear in the field inititally.  Later  */
  418.                /* versions of the library will contain    */
  419.                /* more sophisticated ways of controlling  */
  420.                /* default and initial data display.       */
  421.    fm_clear( fmp );
  422.  
  423.                /* This function does the entire form      */
  424.                /* processing.  It actually consists of two*/
  425.                /* separate parts, a form processor and a  */
  426.                /* field processor although this is hidden */
  427.                /* form the user.  Hooks are provided for  */
  428.                /* user use.  There are ways to perform a  */
  429.                /* user function call before or after a    */
  430.                /* field is processed and also each time a */
  431.                /* key is pressed inside a field.  In      */
  432.                /* addition the user may build a field     */
  433.                /* validation function which may be called */
  434.                /* before a field is exited.           */
  435.    fm_proc( fmp );
  436.  
  437.  
  438.    cur_off();         /* Turn off the cursor to avoid screen clutter   */
  439.  
  440.  
  441.              /* Display a window with the form data in it */
  442.  
  443.    wn1 = wn_make( 0, 0, 24, 80 );
  444.    wn_wnclr( wn1, mk_att( RED, MAGENTA + BRIGHT ) );
  445.    wn_bclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  446.    wn_clear( wn1 );
  447.  
  448.    wn_mkbdr( wn1, BDR_DLNP );
  449.  
  450.    wn_dsply( wn1 );
  451.  
  452.  
  453.    wn_printf( wn1,
  454.     "                Unicorn Software Data Entry System 1.00" );
  455.    wn_printf( wn1, "\n\n" );
  456.  
  457.    wn_printf( wn1,
  458.     "                     Readout of Data Entry Fields\n\n" );
  459.  
  460.  
  461.    wn_printf( wn1,
  462.     "                      Raw unformatted data only\n\n\n\n" );
  463.  
  464.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  465.  
  466.  
  467.    wn_printf( wn1, "\t\t\tThe record number is - <" );
  468.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  469.    wn_printf( wn1, "%s", rec );
  470.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  471.    wn_printf( wn1, ">.\n" );
  472.  
  473.    wn_printf( wn1, "\t\t\tThe first name is ---- <" );
  474.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  475.    wn_printf( wn1, "%s", fname );
  476.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  477.    wn_printf( wn1, ">.\n" );
  478.  
  479.    wn_printf( wn1, "\t\t\tThe last name is ----- <" );
  480.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  481.    wn_printf( wn1, "%s", lname );
  482.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  483.    wn_printf( wn1, ">.\n" );
  484.  
  485.  
  486.    wn_printf( wn1, "\t\t\tThe address is ------- <" );
  487.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  488.    wn_printf( wn1, "%s", addr );
  489.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  490.    wn_printf( wn1, ">.\n" );
  491.  
  492.  
  493.    wn_printf( wn1, "\t\t\tThe city is ---------- <" );
  494.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  495.    wn_printf( wn1, "%s", city );
  496.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  497.    wn_printf( wn1, ">.\n" );
  498.  
  499.    wn_printf( wn1, "\t\t\tThe state is --------- <" );
  500.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  501.    wn_printf( wn1, "%s", state );
  502.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  503.    wn_printf( wn1, ">.\n" );
  504.  
  505.    wn_printf( wn1, "\t\t\tThe zip code --------- <" );
  506.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  507.    wn_printf( wn1, "%s", zip );
  508.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  509.    wn_printf( wn1, ">.\n" );
  510.  
  511.    wn_printf( wn1, "\t\t\tThe phone number ----- <" );
  512.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  513.    wn_printf( wn1, "%s", phone );
  514.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  515.    wn_printf( wn1, ">.\n" );
  516.  
  517.    wn_printf( wn1, "\t\t\tThe birthday is ------ <" );
  518.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  519.    wn_printf( wn1, "%s", birthday );
  520.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  521.    wn_printf( wn1, ">.\n" );
  522.  
  523.    wn_printf( wn1, "\t\t\tThe amount is -------- <" );
  524.    wn_wnclr( wn1, mk_att( RED, WHITE + BRIGHT ) );
  525.    wn_printf( wn1, "%s", amount );
  526.    wn_wnclr( wn1, mk_att( RED, BROWN + BRIGHT ) );
  527.    wn_printf( wn1, ">.\n" );
  528.  
  529.  
  530.    wn_wnclr( wn1, mk_att( RED, BLUE + BRIGHT ) );
  531.  
  532.    wn_printf( wn1, "\n\n\n\t\t\t\t\t\tPress any key to continue" );
  533.  
  534.  
  535.    uc_key();
  536.  
  537.  
  538.    wn_hide( wn1 );
  539.    wn_hide( wnd_message );
  540.    wn_hide( fmp );
  541.  
  542.    wn_hide( wn_title );
  543.  
  544.    wn_wnclr( wn_main, mk_att( BLACK, BLUE + BRIGHT ) );
  545.  
  546.  
  547.    wn_printf( wn_main,
  548.     "\n   We hope you have enjoyed working with this demo of the current\n" );
  549.  
  550.    wn_printf( wn_main,
  551.     "Unicorn Data entry system.  Not all of the capabilities have been\n" );
  552.  
  553.    wn_printf( wn_main,
  554.     "demonstrated but there is enough to get you started building your\n" );
  555.  
  556.    wn_printf( wn_main,
  557.     "own data forms.  Many enhancements are planned in future releases\n" );
  558.  
  559.    wn_printf( wn_main,
  560.     "that will add new capabilities and make the system easier and more\n" );
  561.  
  562.    wn_printf( wn_main,
  563.     "versitile to use.\n" );
  564.  
  565.    wn_wnclr( wn_main, mk_att( BLACK, BROWN + BRIGHT ) );
  566.  
  567.    wn_printf( wn_main, "\n\n\t\t\t\t\tPress any key to return to DOS" );
  568.  
  569.    uc_key();
  570.  
  571.    wn_hide( wn_main );
  572.  
  573.    cur_on();
  574.    cur_restore();
  575. }
  576.  
  577.  
  578.  
  579.  
  580. int before6( char *data )
  581. {
  582.    WINDOWPTR   wnd_before6;
  583.  
  584.    cur_off();
  585.    wnd_before6 = wn_make( 0, 0, 8, 80 );
  586.    wn_wnclr( wnd_before6, mk_att( RED, WHITE + BRIGHT ) );
  587.    wn_bclr( wnd_before6, mk_att( RED, BROWN + BRIGHT ) );
  588.    wn_clear( wnd_before6 );
  589.    wn_margin( wnd_before6, 2 );
  590.    wn_mkbdr( wnd_before6, BDR_DLNP );
  591.    wn_printf( wnd_before6,
  592.    "This is an example of a before field function.  These functions may\n" );
  593.    wn_printf( wnd_before6,
  594.    "be used to inititalize data or for other purposes you may find.\n" );
  595.    wn_printf( wnd_before6,
  596.    "Before field functions are passed a pointer to the current field data\n" );
  597.    wn_printf( wnd_before6,
  598.    "which is <%s>.\n", data );
  599.    wn_printf( wnd_before6,
  600.    "\t\t\t\t\t   Press any key to continue." );
  601.    wn_dsply( wnd_before6 );
  602.    uc_key();
  603.    wn_delete( wnd_before6 );
  604.    cur_on();
  605. }
  606.  
  607.  
  608.  
  609.  
  610.  
  611. int after6( char *data )
  612. {
  613.    WINDOWPTR   wnd_after6;
  614.  
  615.    cur_off();
  616.    wnd_after6 = wn_make( 0, 0, 8, 80 );
  617.    wn_wnclr( wnd_after6, mk_att( RED, WHITE + BRIGHT ) );
  618.    wn_bclr( wnd_after6, mk_att( RED, BROWN + BRIGHT ) );
  619.    wn_clear( wnd_after6 );
  620.    wn_margin( wnd_after6, 2 );
  621.    wn_mkbdr( wnd_after6, BDR_DLNP );
  622.    wn_printf( wnd_after6,
  623.    "This is an example of a after field function.  These functions may\n" );
  624.    wn_printf( wnd_after6,
  625.    "be used to manipulate the data or for other purposes you may find.\n" );
  626.    wn_printf( wnd_after6,
  627.    "After field functions are passed a pointer to the current field data\n" );
  628.    wn_printf( wnd_after6,
  629.    "which is <%s>.\n", data );
  630.    wn_printf( wnd_after6,
  631.    "\t\t\t\t\t   Press any key to continue." );
  632.    wn_dsply( wnd_after6 );
  633.    uc_key();
  634.    wn_delete( wnd_after6 );
  635.    cur_on();
  636. }
  637.