home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBASE.ARC
/
STATEZIP.PRG
< prev
Wrap
Text File
|
1980-01-01
|
3KB
|
140 lines
CLEAR
SET talk OFF
SET intensity OFF
SET EJECT OFF
STORE t TO fileloop
DO WHILE fileloop
ERASE
STORE " " TO filename
@ 02,10 SAY "=================[ STATE - ZIP CHECKER ]" +;
"================="
@ 05,12 SAY "This program checks your inputed file for a" +;
" valid state"
@ 06,12 SAY "and also that the zip code is in that" +;
" states range."
@ 10,12 SAY "What is the name of your file (return to" +;
" EXIT) "
@ 10,61 GET filename
READ
IF filename= " "
ERASE
RETURN
ENDIF filename= " "
IF FILE( "&FILENAME" )
STORE f TO fileloop
ELSE
?? chr(7)
@ 13,12 SAY "Sorry, that file cannot be found!!!"
@ 14,12 SAY "<Press return to CONTINUE>"
?
WAIT
ENDIF FILE( "&FILENAME" )
ENDDO WHILE fileloop
RELEASE fileloop
SELECT PRIMARY
USE &filename
GOTO 1
SELECT secondary
USE statezip INDEX statex
STORE t TO getloop
DO WHILE getloop
STORE "E" TO choice
ERASE
@ 05,05 SAY " E> To EDIT bad records now"
@ 06,05 SAY " P> To PRINT bad rcords, and edit later"
@ 07,05 SAY " X> To EXIT this program"
@ 09,05 SAY "Please make your choice"
@ 09,30 GET choice PICTURE "!"
READ
IF choice= "X"
ERASE
RETURN
ELSE
IF choice= "E" .OR. choice= "P"
STORE f TO getloop
ELSE
?? chr(7)
ENDIF choice= "E" .OR. choice= "P"
ENDIF choice= "X"
ENDDO WHILE getloop
RELEASE getloop
IF choice= "P"
@ 12,05 SAY "Make sure printer is on and press return"
?
WAIT
ENDIF choice= "P"
SELECT PRIMARY
GOTO 1
ERASE
DO WHILE .not. eof
IF *
SKIP
LOOP
ENDIF *
* @ 15,05 SAY "CURRENT RECORD --->"
* @ 15,30 SAY str(#,5)+ " " +zip+ " " +state
STORE zip TO mzip
STORE state TO mstate
SELECT secondary
FIND &mstate
IF #=0
SELECT PRIMARY
IF choice= "P"
SET PRINT ON
SET console OFF
? "INVALID STATE" ,#,state,zip
SET PRINT OFF
SET console ON
SKIP
ELSE
ERASE
STORE # TO save:rec
@ 03,05 SAY "RECORD NUMBER ---> " +str(#,5)
@ 05,05 SAY "Bad state, press return to edit."
@ 06,05 SAY "When finished with edit press (CTRL W)."
?? CHR(7)
WAIT
EDIT #
ERASE
GOTO save:rec
ENDIF choice= "P"
LOOP
ENDIF #=0
STORE low:zip*100 TO low
STORE high:zip*100+99 TO high
IF val(mzip)<low .OR. val(mzip)>high
SELECT PRIMARY
IF choice= "P"
SET PRINT ON
SET console OFF
? "INVALID ZIP " ,#,state,zip
SET PRINT OFF
SET console ON
SKIP
ELSE
ERASE
STORE # TO save:rec
@ 03,05 SAY "RECORD NUMBER ---> " +str(#,5)
@ 05,05 SAY "Bad zip, press return to edit."
@ 06,05 SAY "When finished with edit press (CTRL W)."
?? CHR(7)
WAIT
EDIT #
ERASE
GOTO save:rec
ENDIF choice= "P"
LOOP
ENDIF val(mzip)<low .OR. val(mzip)>high
SELECT PRIMARY
SKIP
ENDDO WHILE .not. eof
ERASE
IF choice= "P"
SET PRINT ON
EJECT
SET PRINT OFF
ENDIF choice= "P"
@ 05,05 SAY "STATE - ZIP checking complete..."
RELEASE ALL
RETURN