* LABEL.CMD
* MICHAEL LYNN 8/25/83
USE
DO WHILE T
ERASE
STORE ' ' TO who
STORE '           ' TO lll
STORE '           ' TO fff
STORE ' ' TO x
STORE 00 TO mvendor   
?
?
? '*********************************************'
? '        LABEL AND ENVELOPE PRINTING'
?
? '1. PRINT ENVELOPE FOR VENDOR'
? '2. PRINT SINGLE LABEL FOR VENDOR'
? '3. PRINT COMPLETE VENDOR LIST ON LABELS'
? '4. PRINT ENVELOPE FOR CUSTOMER'
? '5. PRINT SINGLE LABEL FOR CUSTOMER'
? '6. PRINT COMPLETE CUSTOMER LIST ON LABELS'
?
? '7. EXIT TO MENU'
?
? '********************************************'
?
?
?
?
SET CONSOLE OFF
WAIT TO what
SET CONSOLE ON

ERASE
DO CASE

CASE what ='1'

USE B:VENDOR
@ 3, 1 SAY "ENTER VENDOR NUMBER FOR ENVELOPE PRINTING" GET mvendor PICTURE '99'
READ
LOCATE FOR vendor=mvendor
SET MARGIN TO 0
SET EJECT OFF
SET FORMAT TO PRINT
IF last = ' ' .and. address2 = ' '
@ 13,45 SAY company
@ 14,45 SAY address1
@ 15,45 SAY TRIM(city)+', '+state+' '+zipcode
@ 16,45 SAY country
ELSE
	IF last = ' '
	@ 12,45 SAY company
	@ 13,45 SAY address1
	@ 14,45 SAY address2
	@ 15,45 SAY TRIM(city)+', '+state+' '+zipcode
	@ 16,45 SAY country
	ELSE
		IF address2 = ' '
		@ 12,45 SAY company
		@ 13,45 SAY TRIM(first)+' '+last
		@ 14,45 SAY address1
		@ 15,45 SAY TRIM(city)+', '+state+' '+zipcode
		@ 16,45 SAY country
		ELSE
			@ 12,45 SAY company
			@ 13,45 SAY TRIM(first)+' '+last
			@ 14,45 SAY address1
			@ 15,45 SAY address2
			@ 16,45 SAY TRIM(city)+', '+state+' '+zipcode
			@ 17,45 SAY country
		ENDIF
	ENDIF
ENDIF
EJECT
SET FORMAT TO SCREEN

CASE what ='2'
USE B:VENDOR
@ 3, 1 SAY "ENTER VENDOR NUMBER FOR LABEL PRINTING" GET mvendor PICTURE '99'
READ
LOCATE FOR vendor=mvendor
SET MARGIN TO 0
SET EJECT OFF
SET PRINT ON
IF last = ' ' .and. address2 = ' '
? company
? address1
? TRIM(city)+', '+state+' '+zipcode
? country
?
?
ELSE
	IF last = ' '
	? company
	? address1
	? address2
	? TRIM(city)+', '+state+' '+zipcode
	? country
	?
	ELSE
		IF address2 = ' '
		? company
		? TRIM(first)+' '+last
		? address1
		? TRIM(city)+', '+state+' '+zipcode
		? country
		?
		ELSE
			? company
			? TRIM(first)+' '+last
			? address1
			? address2
			? TRIM(city)+', '+state+' '+zipcode+' '+country
			?
		ENDIF
	ENDIF
ENDIF
SET PRINT OFF

CASE what ='3'
USE B:VENDOR
SET MARGIN TO 0
SET EJECT OFF
SET PRINT ON
DO WHILE .NOT. EOF
IF last = ' ' .and. address2 = ' '
? company
? address1
? TRIM(city)+', '+state+' '+zipcode
? country
?
?
ELSE
	IF last = ' '
	? company
	? address1
	? address2
	? TRIM(city)+', '+state+' '+zipcode
	? country
	?
	ELSE
		IF address2 = ' '
		? company
		? TRIM(first)+' '+last
		? address1
		? TRIM(city)+', '+state+' '+zipcode
		? country
		?
		ELSE
			? company
			? TRIM(first)+' '+last
			? address1
			? address2
			? TRIM(city)+', '+state+' '+zipcode+' '+country
			?
		ENDIF
	ENDIF
ENDIF
SKIP
ENDDO
SET PRINT OFF 

CASE what ='4'
USE B:NAMES INDEX B:INDLAST
@ 3, 1 SAY "ENTER LAST NAME" GET lll PICTURE '!AAAAAAAAAA'
@ 4, 1 SAY "ENTER FIRST NAME" GET fff PICTURE '!AAAAAAAAAA'
READ
FIND &lll

 DO WHILE last=lll .and. first # fff
 SKIP
 ENDDO

IF last=lll .and. first=fff 
   STORE 'X' to who
ENDIF

IF who =' '
@ 14, 5 SAY '********************'
@ 15, 5 SAY 'NAME NOT IN DATABASE'
@ 16, 5 SAY '********************'
ELSE
SET MARGIN TO 0
SET EJECT OFF
SET FORMAT TO PRINT
	IF company = ' '
	@ 12,45 SAY TRIM(first)+' '+last
	@ 13,45 SAY address
	@ 14,45 SAY TRIM(city)+', '+state+' '+zipcode
	ELSE
		@ 12,45 SAY company
		@ 13,45 SAY TRIM(first)+' '+last
		@ 14,45 SAY address
		@ 15,45 SAY TRIM(city)+', '+state+' '+zipcode
	ENDIF
ENDIF
EJECT
SET FORMAT TO SCREEN

CASE what ='5'
USE B:NAMES INDEX B:INDLAST
@ 3, 1 SAY "ENTER LAST NAME" GET lll PICTURE '!AAAAAAAAAA'
@ 4, 1 SAY "ENTER FIRST NAME" GET fff PICTURE '!AAAAAAAAAA'
READ
FIND &lll

 DO WHILE last=lll .and. first # fff
 SKIP
 ENDDO

IF last=lll .and. first=fff 
   STORE 'X' to who
ENDIF

IF who =' '
@ 14, 5 SAY '********************'
@ 15, 5 SAY 'NAME NOT IN DATABASE'
@ 16, 5 SAY '********************'
ELSE
SET MARGIN TO 0
SET EJECT OFF
SET PRINT ON
	IF company = ' '
	? TRIM(first)+' '+last
	? address
	? TRIM(city)+', '+state
	? zipcode
	?
	?
	ELSE
		? company
		? TRIM(first)+' '+last
		? address
		? TRIM(city)+', '+state+' '+zipcode
		?
		?
	ENDIF
ENDIF
SET PRINT OFF

CASE what ='6'
USE B:NAMES INDEX B:INDLAST
SET MARGIN TO 0
SET EJECT OFF
SET PRINT ON
DO WHILE .NOT. EOF
	IF company = ' '
	? TRIM(first)+' '+last
	? address
	? TRIM(city)+', '+state
	? zipcode
	?
	?
	ELSE
		? company
		? TRIM(first)+' '+last
		? address
		? TRIM(city)+', '+state+' '+zipcode
		?
		?
	ENDIF
SKIP
ENDDO
SET PRINT OFF

CASE WHAT ='7'
RETURN

ENDCASE
ENDDO
