home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / GENERAL / USDA_NDB.ZIP / USDA.PRG < prev    next >
Text File  |  1991-11-17  |  2KB  |  85 lines

  1. * Program..: USDA Nutrient Database display program for CLIPPER Compiler
  2. * created to display the data found on CRS BBS uploaded by others.
  3. * Don't blame me if you get fat cause the data is wrong. I just wrote
  4. * the display program, not the data.
  5. * Author...: DAVE SAGE
  6. * Date.....: 11/17/91
  7. * Notice...: Copyright (c) 1991, DAVE SAGE, All Rights Reserved
  8. * Notes....: 
  9. * ok so it could use some improvement. What do you want for a Sunday
  10. * afternoon?
  11.  
  12. SET TALK OFF
  13. SET BELL OFF
  14. SET STATUS OFF
  15. SET SCOREBOARD OFF
  16. SET ESCAPE ON
  17. SET CONFIRM ON
  18. SET COLOR TO GR+/b,GR+/b,B,B
  19.  
  20. IF .NOT. FILE("USDADESC.NTX")
  21.  CLEAR
  22.  @15,0 SAY "Standby..... Creating missing Index file. This could take a while"
  23.  USE USDA
  24.  INDEX ON DESC TO USDADESC
  25.  CLEAR
  26. else
  27.  USE USDA INDEX USDADESC
  28. endif
  29. GO TOP
  30. SET PROCEDURE TO USDAPROC
  31.  
  32. some_more = "J"
  33. DO while .T.
  34.  
  35.     DO CASE
  36.      CASE some_more = "N"
  37.       SKIP
  38.        IF EOF()
  39.         GO TOP
  40.        ENDIF
  41.  
  42.      CASE some_more = "P"
  43.           * wrap around to bottom if at the top
  44.        SKIP -1
  45.        IF BOF()
  46.         GO BOTTOM
  47.        ENDIF
  48.  
  49.      CASE some_more = "J"
  50.        CLEAR
  51.        store '                    ' to describe
  52.        @11,5 SAY " (or the first few letters will do)"
  53.        @10,0 SAY "Enter a food to search for (RETURN to exit) ====> " GET describe PICTURE "@!XXXXXXXXXXXXXXXXXXXX"
  54.        READ
  55.        if describe = " "
  56.         some_more = "X"
  57.         found_it = .F.
  58.        endif
  59.        if some_more = "J"
  60.         store rtrim(describe) to describe
  61.         found_it = .T.
  62.         SEEK describe
  63.         if .NOT. FOUND()
  64.          CLEAR
  65.          @10,0 SAY "Sorry nothing close to that on file"
  66.          @11,0 SAY ""
  67.          wait
  68.          go top
  69.          found_it = .F.
  70.         endif
  71.        endif
  72.  
  73.     ENDCASE
  74.    if .NOT. EOF() .AND. found_it
  75.      do showone
  76.      do askmore
  77.     endif
  78.    if some_more = "X"
  79.     clear
  80.     close all
  81.     exit
  82.    endif
  83. ENDDO T
  84. RETURN
  85.