home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beter Homes & Gardens: Complete Guide to Gardening
/
GARDENS.BIN
/
gardens
/
index
/
idxvarbl.bak
< prev
next >
Wrap
Text File
|
1994-03-30
|
3KB
|
118 lines
SET exclusive off
SET safety off
SELECT 1
USE d:\grdncd\gardens\index\index.dbf EXCLUSIVE
ZAP
APPEND FROM d:\grdncd\gardens\ann\annvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "ANN" FOR section = " "
APPEND FROM d:\grdncd\gardens\bul\bulvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "BUL" FOR section = " "
APPEND FROM d:\grdncd\gardens\fru\fruvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "FRU" FOR section = " "
APPEND FROM d:\grdncd\gardens\her\hervar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "HER" FOR section = " "
APPEND FROM d:\grdncd\gardens\ind\indvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "IND" FOR section = " "
APPEND FROM d:\grdncd\gardens\law\lawvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "LAW" FOR section = " "
APPEND FROM d:\grdncd\gardens\per\pervar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "PER" FOR section = " "
APPEND FROM d:\grdncd\gardens\ros\rosvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "ROS" FOR section = " "
APPEND FROM d:\grdncd\gardens\shr\shrvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "SHR" FOR section = " "
APPEND FROM d:\grdncd\gardens\tre\trevar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "TRE" FOR section = " "
APPEND FROM d:\grdncd\gardens\veg\vegvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "VEG" FOR section = " "
APPEND FROM d:\grdncd\gardens\vin\vinvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "VIN" FOR section = " "
APPEND FROM d:\grdncd\gardens\wil\wilvar.dbf FIELDS lstname, botan, dir
REPLACE ALL section WITH "WIL" FOR section = " "
SET ORDER TO TAG lstname
SET FILTER TO DELETED() = .F.
GOTO TOP
* Housekeeping
index = 1
handle = 0
list = ""
* SET up file handle
filename = "d:\grdncd\gardens\index\index.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
* Done for each record
DO WHILE .NOT. EOF()
* Output name
=FWRITE(handle,'@name[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,ALLTRIM(lstname))
* Output botanical name
=FWRITE(handle,'@botan[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,IIF(botan=" ","None",ALLTRIM(botan)))
* Output section
=FWRITE(handle,'@type[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,ALLTRIM(section))
* Output directory
=FWRITE(handle,'@dir[')
=FWRITE(handle,ALLTRIM(STR(index)))
=FPUTS(handle,']')
=FPUTS(handle,ALLTRIM(dir))
list = list + ALLTRIM(lstname) + ";"
* Increment and get next record
index = index + 1 && increment list index
SKIP && get next record
enddo
* Output final list total
=FPUTS(handle,'@total')
=FPUTS(handle,ALLTRIM(STR(index-1)))
* Output list string
=FPUTS(handle,'@list')
=FPUTS(handle,SUBSTR(list,1,LEN(list)-1))
*=FPUTS(handle,list)
CLOSE DATABASE
SELECT DISTINCT botan FROM d:\grdncd\gardens\index\index.dbf INTO DBF temp ORDER BY botan
blist = ""
DO WHILE .NOT. EOF()
blist = IIF(botan=" ",blist,blist + ALLTRIM(botan) + ";")
SKIP
ENDDO
* Output blist string
=FPUTS(handle,'@blist')
=FPUTS(handle,SUBSTR(blist,1,LEN(blist)-1))
* Close file
=FCLOSE(handle)