home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / xbase / library / clipper / progr_ba / demo.prg < prev    next >
Text File  |  1992-03-01  |  3KB  |  89 lines

  1. /*----------------------------------------------------------------------------
  2.  
  3.    STATUS version 1.01
  4.    (c) 1992 John T. Opincar, Jr.
  5.    CID: 71631,541
  6.    02/27/92 
  7.  
  8.    PLEASE READ THIS!
  9.                                        
  10.    You are free to distribute STATUS in any manner you choose and use STATUS
  11.    in any setting, including commercial without any obligation to me.  The
  12.    only thing that I ask is that you do not distribute modified versions of
  13.    STATUS without including the original code and documentation in its
  14.    entirety.  If you feel inclined to distribute STATUS with your own 
  15.    modifications (which I would discourage), ***PLEASE*** keep your changes
  16.    in seperate files, and make the seperation and changes obvious to anyone
  17.    who might subsequently encounter the ZIP.
  18.  
  19.    I have been informally supporting STATUS on CIS, and do not want a zillion
  20.    messages about problems introduced by others.  In lieu of making your own
  21.    changes, I would prefer that you send me mail describing the additional
  22.    features you would like to see in STATUS.  The exceptional performance
  23.    gains yielded by STATUS are the result of several key assumptions about 
  24.    how it will be used.  Before making a suggestion, please read the section
  25.    in the documentation entitled, "What Makes STATUS Tick." The main 
  26.    motivation behind this version of STATUS was input I received from users.
  27.  
  28. ----------------------------------------------------------------------------*/
  29.  
  30. local cycle := 0
  31.  
  32. * begin
  33.   @ 0,0 clear
  34.   if ( !file('demo.dbf') )
  35.     ? 'Creating demo.dbf'
  36.     dbCreate('demo', { {'FIRST', 'C', 12, 0}, ;
  37.                        {'MIDDLE', 'C', 1, 0}, ;
  38.                        {'LAST', 'C', 15, 0}, ;
  39.                        {'PHONE', 'C', 12, 0}, ;
  40.                        {'ADDRESS', 'C', 35, 0}, ;
  41.                        {'CITY', 'C', 15, 0}, ;
  42.                        {'STATE', 'C', 2, 0}, ;
  43.                        {'ZIP', 'C', 10, 0} })
  44.   endIf
  45.   use
  46.   use demo                  
  47.   if ( lastRec() < 5000 )
  48.     ? 'Filling demo.dbf'
  49.     while ( lastRec() < 5000 )
  50.       dbAppend()
  51.       do case
  52.       case ( cycle == 0 )
  53.         DEMO->FIRST := 'Charles'
  54.         DEMO->MIDDLE := 'B'
  55.         DEMO->LAST := 'Balogne'
  56.         DEMO->PHONE := '(555)555-5555'
  57.         DEMO->ADDRESS := '1012 Main Street'
  58.         DEMO->CITY := 'Lewisville'
  59.         DEMO->STATE := 'ND'
  60.         DEMO->ZIP := '40056-1023'
  61.       case ( cycle == 1 )
  62.         DEMO->FIRST := 'John'
  63.         DEMO->MIDDLE := 'K'
  64.         DEMO->LAST := 'Salami'
  65.         DEMO->PHONE := '(201)555-1234'
  66.         DEMO->ADDRESS := '6968 Abuda'
  67.         DEMO->CITY := 'Houston'
  68.         DEMO->STATE := 'TX'
  69.         DEMO->ZIP := '77051'
  70.       case ( cycle == 2 )
  71.         DEMO->FIRST := 'Marilyn'
  72.         DEMO->MIDDLE := 'S'
  73.         DEMO->LAST := 'Beefjerky'
  74.         DEMO->PHONE := '(514)222-3333'
  75.         DEMO->ADDRESS := '4156 Caroline St.'
  76.         DEMO->CITY := 'New York'
  77.         DEMO->STATE := 'NY'
  78.         DEMO->ZIP := '10023-1100'
  79.       endCase          
  80.       cycle := (cycle + 1) % 3
  81.     endDo
  82.   endIf
  83.   use
  84.   statusPack('demo', { {'demoname', 'upper(LAST) + upper(FIRST)'}, ;
  85.                        {'demophon', 'PHONE'}, ;
  86.                        {'democity', 'upper(CITY)'}, ;
  87.                        {'demozip', 'ZIP'} })
  88. return
  89.