home *** CD-ROM | disk | FTP | other *** search
/ Beter Homes & Gardens: Complete Guide to Gardening / GARDENS.BIN / gardens / howto / howvarbl.prg < prev    next >
Text File  |  1994-03-28  |  1KB  |  55 lines

  1. SET exclusive off
  2. SET safety off
  3.  
  4. USE d:\grdncd\gardens\howto\howto.dbf EXCLUSIVE
  5.  
  6. * Housekeeping
  7. index = 1
  8. handle = 0
  9.  
  10. * SET up file handle
  11. filename = "d:\grdncd\gardens\howto\howto.var"
  12. IF FILE(filename)
  13.     ERASE filename
  14.     handle = FCREATE(filename)    && If not create it
  15. *    handle = FOPEN(filename,12)    && If so, open read/write
  16. ELSE
  17.     handle = FCREATE(filename)    && If not create it
  18. ENDIF
  19.  
  20. =FPUTS(handle,'@howname')
  21. =FPUTS(handle,'Annuals')
  22. list = ""
  23.  
  24. * Done for each record
  25. DO WHILE .NOT. EOF()
  26.  
  27. * Output tip
  28.         =FWRITE(handle,'@kind[')
  29.         =FWRITE(handle,ALLTRIM(STR(index)))
  30.         =FPUTS(handle,']')
  31.         =FPUTS(handle,SUBSTR(type,1,3))
  32.         =FWRITE(handle,'@htname[')
  33.         =FWRITE(handle,ALLTRIM(STR(index)))
  34.         =FPUTS(handle,']')
  35.         =FPUTS(handle,ALLTRIM(media))
  36.  
  37.         list = list + ALLTRIM(section) + ";"
  38.  
  39. * Increment and get next record
  40.     index = index + 1    && increment list index
  41.     SKIP    && get next record
  42.  
  43. enddo
  44.  
  45. =FPUTS(handle,'@list')
  46. =FPUTS(handle,SUBSTR(list,1,LEN(list)-1))
  47.  
  48. * Output final list total
  49. =FPUTS(handle,'@total')
  50. =FPUTS(handle,ALLTRIM(STR(index-1)))
  51.  
  52. * Close file
  53. =FCLOSE(handle)
  54.  
  55.