home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / DB3STOCK.ZIP / DB3STOCK.SKL < prev    next >
Encoding:
Text File  |  1986-04-12  |  11.3 KB  |  360 lines

  1.   procedure bigboxdt
  2.   * -----------------------------------------------------
  3.   * BIGBOXDT - draws a large box for major screen display
  4.   * -----------------------------------------------------
  5.   * define HEADER as a str < 60 chars before entering this routine
  6.   SET COLOR TO 7/0
  7.   @ 1,0 SAY "╔══════════════════════════════════════════════════════"
  8.   @ 1,55 SAY "═══════════════════════╗"
  9.   L=2
  10.   DO WHILE L<24
  11.      @ L,0 SAY "║"
  12.      @ L,78 SAY "║"
  13.      L=L+1
  14.   ENDDO
  15.   @ 24,0 SAY "╚══════════════════════════════════════════════════════"
  16.   @ 24,55 SAY "═══════════════════════╝"
  17.   @ 3, 1 SAY "---------------------------------------"
  18.   @ 3,40 SAY "--------------------------------------"
  19.   @ 2,3 say date()
  20.   @ 2,69 say time()
  21.   * H E A D E R  programming set up below
  22.   set color to 15/0
  23.   @ 2,(80-len(header))/2 say header
  24.   set color to 7/0
  25.   RETURN
  26.   
  27.   procedure boxclear
  28.   * ---------------------------------------------------------------
  29.   * BOXCLEAR.prg - a routine that clears the screen INSIDE BIGBOXDT
  30.   * ---------------------------------------------------------------
  31.   * define LN BEFORE coming into this routine
  32.   do while ln<24
  33.      @ ln,1 say space(77)
  34.      ln=ln+1
  35.   enddo
  36.   RETURN
  37.   
  38.   
  39.   procedure smallbox
  40.   * -----------------------------------------------------------
  41.   * SMALLBOX.prg - a routine that draws a smaller box on screen
  42.   * -----------------------------------------------------------
  43.   @ 4,12 SAY "┌───────────────────────────────────────────────────────┐"
  44.   L=5
  45.   DO WHILE L<21
  46.      @ L,12 SAY "│"
  47.      @ L,68 SAY "│"
  48.      L=L+1
  49.   ENDDO
  50.   @21,12 SAY "└───────────────────────────────────────────────────────┘"
  51.   RETURN
  52.   
  53.   procedure lineboxm
  54.   * ------------------------------------------------------------------
  55.   * LINEBOXM.prg - draws a single line box in the middle of the screen
  56.   * ------------------------------------------------------------------
  57.   * define MSG as a str <55 chars before entering this routine
  58.   @ 11,12 SAY "┌───────────────────────────────────────────────────────┐"
  59.   @ 12,12 SAY "│"
  60.   @ 12,68 SAY "│"
  61.   @ 13,12 SAY "└───────────────────────────────────────────────────────┘"
  62.   set color to 15/0
  63.   @12,(80-len(msg))/2 say msg
  64.   set color to 7/0
  65.   RETURN
  66.   
  67.  
  68.   procedure slinboxm
  69.   * ------------------------------------------------------------------
  70.   * SLINBOXM.prg - draws a single line box in the middle of the screen
  71.   * ------------------------------------------------------------------
  72.   * define MSG as a str <55 chars before entering this routine
  73.   SET COLOR TO 7/0
  74.   @ 11,12 SAY "┌───────────────────────────────────────────────────────┐"
  75.   @ 12,12 SAY "│"
  76.   @ 12,68 SAY "│"
  77.   @ 13,12 SAY "└───────────────────────────────────────────────────────┘"
  78.   set color to 15/0
  79.   @12,(80-len(msg))/2 say msg
  80.   set color to 7/0
  81.   RETURN
  82.   
  83.   
  84.   procedure slinboxt
  85.   * ------------------------------------------------------------------
  86.   * SLINBOXT.prg - draws a single line box at the top of the screen
  87.   * ------------------------------------------------------------------
  88.   * define MSG as a str <55 chars before entering this routine
  89.   SET COLOR TO 7/0
  90.   @  1,12 SAY "┌───────────────────────────────────────────────────────┐"
  91.   @  2,12 SAY "│"
  92.   @  2,68 SAY "│"
  93.   @  3,12 SAY "└───────────────────────────────────────────────────────┘"
  94.   set color to 15/0
  95.   @ 2,(80-len(msg))/2 say msg
  96.   set color to 7/0
  97.   RETURN
  98.   
  99.   procedure slinboxb
  100.   * ------------------------------------------------------------------
  101.   * SLINBOXB.prg - draws a single line box at the bottom of the screen
  102.   * ------------------------------------------------------------------
  103.   * define MSG as a str <55 chars before entering this routine
  104.   SET COLOR TO 7/0
  105.   @ 22,12 SAY "┌───────────────────────────────────────────────────────┐"
  106.   @ 23,12 SAY "│"
  107.   @ 23,68 SAY "│"
  108.   @ 24,12 SAY "└───────────────────────────────────────────────────────┘"
  109.   set color to 15/0
  110.   @23,(80-len(msg))/2 say msg
  111.   set color to 7/0
  112.   RETURN
  113.  
  114.  
  115.   procedure dlinboxm
  116.   * ------------------------------------------------------------------
  117.   * DLINBOXM.prg - draws a double line box at the middle of the screen
  118.   * ------------------------------------------------------------------
  119.   * define MSG as a str <55 chars before entering this routine
  120.   SET COLOR TO 7/0
  121.   @ 11,12 SAY "╔═══════════════════════════════════════════════════════╗"
  122.   @ 12,12 SAY "║"
  123.   @ 12,68 SAY "║"
  124.   @ 13,12 SAY "╚═══════════════════════════════════════════════════════╝"
  125.   set color to 15/0
  126.   @12,(80-len(msg))/2 say msg
  127.   set color to 7/0
  128.   RETURN
  129.  
  130.  
  131.   procedure dlinboxt
  132.   * ------------------------------------------------------------------
  133.   * DLINBOXT.prg - draws a double line box at the top of the screen
  134.   * ------------------------------------------------------------------
  135.   * define MSG as a str <55 chars before entering this routine
  136.   SET COLOR TO 7/0
  137.   @  1,12 SAY "╔═══════════════════════════════════════════════════════╗"
  138.   @  2,12 SAY "║"
  139.   @  2,68 SAY "║"
  140.   @  3,12 SAY "╚═══════════════════════════════════════════════════════╝"
  141.   set color to 15/0
  142.   @ 2,(80-len(msg))/2 say msg
  143.   set color to 7/0
  144.   RETURN
  145.  
  146.  
  147.   procedure dlinboxb
  148.   * ------------------------------------------------------------------
  149.   * DLINBOXB.prg - draws a double line box at the bottom of the screen
  150.   * ------------------------------------------------------------------
  151.   * define MSG as a str <55 chars before entering this routine
  152.   SET COLOR TO 7/0
  153.   @ 22,12 SAY "╔═══════════════════════════════════════════════════════╗"
  154.   @ 23,12 SAY "║"
  155.   @ 23,68 SAY "║"
  156.   @ 24,12 SAY "╚═══════════════════════════════════════════════════════╝"
  157.   set color to 15/0
  158.   @23,(80-len(msg))/2 say msg
  159.   set color to 7/0
  160.   RETURN
  161.  
  162.  
  163.   procedure linprm23
  164.   * --------------------------------------
  165.   * LINPRM23.PRG - GET A PARTICULAR KEY
  166.   * --------------------------------------
  167.   * define MSG as a str <75 chars before entering this routine
  168.   * define TEST as a target string of chars to test FOR
  169.   * define TZ as PUBLIC, and then initialize to " " before using this routine
  170.   @ 23,1 say space(77)
  171.   set color to 15/0
  172.   @ 23,(80-len(msg))/2 say msg
  173.   set color to 7/0
  174.   tz=" "
  175.   do while at(tz,test)=0
  176.      tz=" "
  177.      CLEAR GETS
  178.      tkol=((80-len(msg))/2)+len(msg)+2
  179.      if tkol>77
  180.         tkol=77
  181.      endif
  182.      @ 23,tkol get tz picture "!"
  183.      read
  184.   enddo
  185.   set color to 7/0
  186.   @ 23,1 SAY SPACE(77)
  187.   RETURN
  188.  
  189.   procedure linmsg23
  190.   * --------------------------------------
  191.   * LINMSG23.PRG - GET ANY KEY TO CONTINUE
  192.   * --------------------------------------
  193.   * define MSG as a str <75 chars before entering this routine
  194.   @ 23,1 say space(77)
  195.   set color to 15/0
  196.   @ 23,(80-len(msg))/2 say msg
  197.   set color to 7/0
  198.   zz=" "
  199.   tkol=((80-len(msg))/2)+len(msg)+2
  200.   if tkol>77
  201.    tkol=77
  202.   endif
  203.   @ 23,tkol get zz
  204.   read
  205.   set color to 7/0
  206.   @ 23,1 SAY SPACE(77)
  207.   RETURN
  208.  
  209.  
  210.   procedure prtmsg23
  211.   * --------------------------------------------------------------
  212.   * PRTMSG23.PRG - prints a message ONLY on line 23; no gets/reads
  213.   * --------------------------------------------------------------
  214.   * define MSG as a str <75 chars before entering this routine
  215.   @23,1 say space(77)
  216.   set color to 15/0
  217.   @23,(80-len(msg))/2 say msg
  218.   set color to 7/0
  219.   RETURN
  220.  
  221.  
  222.   procedure getfld23
  223.   * --------------------------------------
  224.   * GETFLD23.PRG - GET A PARTICULAR FIELD
  225.   * --------------------------------------
  226.   * define KOL as 0 before entering the routine.
  227.   * define FEELD as any EMPTY string of any length.
  228.   * define MSG as a str <75 chars before entering this routine
  229.   * the variable KOL is now the new column position at which to GET the field
  230.   msg=msg+"  "+feeld
  231.   @ 23,1 say space(77)
  232.   set color to 15/0
  233.   @ 23,(80-len(msg))/2 say msg
  234.   set color to 7/0
  235.   kol=col()-len(feeld)
  236.   if kol>77
  237.      kol=77
  238.   endif
  239.   RETURN
  240.  
  241.  
  242.  
  243.   procedure prevmo
  244.   * ----------------------------------------------------------
  245.   * Prevmo.prg -- finds the ACTUAL month of the previous month
  246.   * ----------------------------------------------------------
  247.   * must define PMONTH as a blank string BEFORE entering this routine
  248.   Tmonth=substr(dtoc(date(),1,2)+"/"+substr(dtoc(date(),7,2)
  249.   Pmo=ctod(substr(Tmonth,1,2)+"/15/"+substr(Tmonth,4,2))
  250.   Pmo=Pmo-30
  251.   Pmonth=substr(dtoc(Pmo),1,2)+"/"+substr(dtoc(Pmo),7,2)
  252.   RETURN
  253.  
  254.   procedure nextmo
  255.   * ----------------------------------------------------------
  256.   * Nextmo.prg -- finds the ACTUAL month of the next month
  257.   * ----------------------------------------------------------
  258.   *  must define NMONTH as a blank string BEFORE entering this routine
  259.   Tmonth=substr(dtoc(date(),1,2)+"/"+substr(dtoc(date(),7,2)
  260.   Nmo=ctod(substr(Tmonth,1,2)+"/15/"+substr(Tmonth,4,2))
  261.   Nmo=Nmo+30
  262.   Nmonth=substr(dtoc(Nmo),1,2)+"/"+substr(dtoc(Nmo),7,2)
  263.   RETURN
  264.  
  265.   procedure passwerd
  266.   * -------------------------------------------------------------
  267.   * PASSWERD.PRG - COMPLETE SECURITY PROGRAM FOR AUTHORIZED USERS
  268.   * -------------------------------------------------------------
  269.   use SECURITY.dbf
  270.   go top
  271.   delete all for enterok=space(12)
  272.   pack
  273.   go top
  274.   mastrpass=trim(enterok)
  275.   header="Authorized Users Check"
  276.   do bigboxdt
  277.   ct=1
  278.   password=space(12)
  279.   nupasswd=space(12)
  280.   MSG=" "
  281.   do dlinboxm
  282.   do while .t.
  283.      @ 12,14 say space(50)
  284.      password=space(12)
  285.      @ 12,23 say "Enter your PASSWORD:  "
  286.      SET console Off
  287.      ACCEPT TO PASSWORD
  288.      SET console ON
  289.      @ 12,14 say space(50)
  290.      @ 12,20 say "Checking authorized users.  Please wait."
  291.      password=upper(password)
  292.      nupass=""
  293.      z=1
  294.      do while z<len(password)+1
  295.         tz=asc(substr(password,z,1))+117
  296.         nupass=nupass+chr(tz)
  297.         z=z+1
  298.      enddo
  299.      go top
  300.      locate for nupass=trim(enterok)
  301.      if eof()
  302.         @ 12,14 say space(50)
  303.         ct=ct+1
  304.         if ct>5
  305.            set color to 15/0
  306.            @ 12,21 say "I think you are an unauthorized user."
  307.            set color to 7/0
  308.            set console off
  309.            set escape off
  310.            do while .t.
  311.               loop
  312.            enddo
  313.          else
  314.            msg="Wrong SECURITY CODE.  Press any key to continue."
  315.            do linmsg23
  316.            loop
  317.         endif
  318.      endif
  319.      if nupass<>mastrpass
  320.         exit
  321.      endif
  322.      * ---------------------------------------
  323.      * PASSWORD ADDITION ROUTINE follows here:
  324.      * ---------------------------------------
  325.      do while .t.
  326.         @ 12,14 say space(50)
  327.         @ 12,21 say "Enter a password to add:  "
  328.         set console OFF
  329.         ACCEPT TO NUPASSWD
  330.         nupasswd=upper(nupasswd)
  331.         set console on
  332.         nupass=""
  333.         nupasswd=trim(nupasswd)
  334.         z=1
  335.         do while z<len(nupasswd)+1
  336.            tz=asc(substr(nupasswd,z,1))+117
  337.            nupass=nupass+chr(tz)
  338.            z=z+1
  339.         enddo
  340.         append blank
  341.         replace enterok with nupass
  342.         msg="Enter another NEW password?  <Y/N>  "
  343.         test="YN"
  344.         do linprm23
  345.         if tz="Y"
  346.            loop
  347.           else
  348.            exit
  349.         endif
  350.      enddo
  351.      * -----------------------------------
  352.      * PASSWORD ADDITION ROUTINE ends here
  353.      * -----------------------------------
  354.   enddo
  355.   use
  356.   set color to 15/0
  357.   @ 23,6 say "The System identifies you.  Welcome!  Please wait."
  358.   set color to 7/0
  359.   RETURN
  360.