home *** CD-ROM | disk | FTP | other *** search
- * This is generic dBase III Code and will run within dBAse III and dBase IV
- * To compile for Clipper:
- * Clipper demo.prg
- * RTLINK FI demo
-
- set confirm on
- set color to w/b
- set talk off
- set scoreboard off
- set bell off
- clear
- set status off
- USE zipcodes
- * Check for existance of ndx file. If it is not present, query ì
- * for creation of file
-
- IF .NOT. FILE("ZIPS.NDX") .AND. .NOT. FILE("ZIPS.NTX")
- CLEAR
- answer = .t.
- @ 1,1 SAY "You need an index file, requiring approximately 800K"
- @ 2,1 say "of space:"
- @ 2,10 say " Continue?" get answer
- read
- if answer
- set talk on
- clear
- @ 12,36 say "Indexing"
- index on zipcode to zips
- set talk off
- clear
- else
- cancel
- endif
- else
- set index to zips
- endif
-
- * Open address database
- select 2
- use demo
- * Now enter data
- append blank
- do while .t.
- sele 2
- @ 3, 29 SAY "Help Software Demo"
- @ 6, 9 SAY "First Name:"
- @ 6, 26 GET DEMO->FNAME
- @ 8, 9 SAY "Last Name:"
- @ 8, 26 GET DEMO->LNAME
- @ 10, 9 SAY "Address:"
- @ 10, 26 GET DEMO->ADDRESS
- @ 12, 9 SAY "City:"
- @ 12, 26 SAY DEMO->CITY
- @ 14, 9 SAY "State:"
- @ 14, 26 SAY DEMO->STATE
- @ 14, 32 SAY "Zip Code:"
- @ 14, 43 GET DEMO->ZIPCODE
- @ 16, 9 SAY "Phone:"
- @ 16, 16 SAY DEMO->PHONE PICTURE "( ) - "
- @ 2, 8 TO 17, 69
- @ 4, 9 TO 4, 68
- @ 18,27 SAY "Press ESC to Abort Program"
- read
-
- * Check for ESC key
- if readkey() = 12
- exit
- endif
-
- huntzip=zipcode
- select 1
-
- * If no Zipcode, then loop back through the record
- if DEMO->ZIPCODE = space(5)
- loop
- endif
-
- find &huntzip
- if found()
- select 2
- *move data into database
- replace zipcode with a->zipcode,;
- state with a->state,;
- city with a->city
-
- @ 12, 9 SAY "City:"
- @ 12, 26 SAY DEMO->CITY
- @ 14, 9 SAY "State:"
- @ 14, 26 SAY DEMO->STATE
- @ 16, 16 GET DEMO->PHONE PICTURE "(999) 999-9999"
- READ
- else
- @ 22,0
- wait "That zip code is not on file...any key to continue"
- endif
- @ 23,0 clear to 23,79
- append blank
- enddo
- close all
-
-
-