home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beter Homes & Gardens: Complete Guide to Gardening
/
GARDENS.BIN
/
gardens
/
howto
/
howvarbl.prg
< prev
next >
Wrap
Text File
|
1994-03-28
|
1KB
|
55 lines
SET exclusive off
SET safety off
USE d:\grdncd\gardens\howto\howto.dbf EXCLUSIVE
* Housekeeping
index = 1
handle = 0
* SET up file handle
filename = "d:\grdncd\gardens\howto\howto.var"
IF FILE(filename)
ERASE filename
handle = FCREATE(filename) && If not create it
* handle = FOPEN(filename,12) && If so, open read/write
ELSE
handle = FCREATE(filename) && If not create it
ENDIF
=FPUTS(handle,'@howname')
=FPUTS(handle,'Annuals')
list = ""
* Done for each record
DO WHILE .NOT. EOF()
* Output tip
=FWRITE(handle,'@kind[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,SUBSTR(type,1,3))
=FWRITE(handle,'@htname[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,ALLTRIM(media))
list = list + ALLTRIM(section) + ";"
* Increment and get next record
index = index + 1 && increment list index
SKIP && get next record
enddo
=FPUTS(handle,'@list')
=FPUTS(handle,SUBSTR(list,1,LEN(list)-1))
* Output final list total
=FPUTS(handle,'@total')
=FPUTS(handle,ALLTRIM(STR(index-1)))
* Close file
=FCLOSE(handle)