** Last revision: June 18, 1986 at 22:23 * proc.prg procedure file PROC s_first CLEA @ 3, 3 SAY "Lastname:" @ 3,46 SAY "First & MI:" @ 4, 5 SAY "Spouse:" @ 4,46 SAY "Address as:" @ 6, 6 SAY "Title:" @ 7, 1 SAY "Company #1:" @ 8, 9 SAY "#2:" @ 9, 0 SAY "Co. Address:" @ 9,51 SAY "Suite:" @ 10, 7 SAY "City:" @ 10,36 SAY "State:" @ 10,53 SAY "Zip:" @ 12, 2 SAY "Home Addr:" @ 12,53 SAY "Apt:" @ 13, 7 SAY "City:" @ 13,36 SAY "State:" @ 13,53 SAY "Zip:" @ 14, 2 SAY "Telephone Office:" @ 14,46 SAY "Home phone:" @ 15, 1 SAY "Salutation:" @ 15,42 SAY "Send to office:" @ 16,07 SAY "List:" @ 16,37 SAY "Code:" @ 16,50 SAY "Update:" RETU PROC check TSTATE = "AKALARAZCACOCTDCDEFLGAHIIAIDILINKSKY"; +"LAMAMDMEMIMNMOMSMTNCNDNENHNJNMNVNYOH"; +"OKORPARISCSDTNTXUTVAVTWAWIWVWY " DO CASE CASE mfname = ' ' * no firstname STOR .t. TO error CASE mmr = ' ' * no mister STOR .t. TO error * bad state CASE MOD(AT(mcst,'&tstate'),2) = 0 STOR .t. TO error CASE MOD(AT(mst,'&tstate'),2) = 0 STOR .t. TO error CASE mdear = ' ' * no salutation STOR .t. TO error CASE .NOT. (msend = 'Y' .OR. msend = 'N') * no send command STOR .t. TO error OTHE STOR .f. TO error ENDC * if test for error was true then fix the fields that need fixing IF error IF .NOT. clipper SET COLOR TO &revvideo ENDIF @ 20,01 SAY SPACE(77) @ 20,24 SAY 'Please correct indicated data.' IF .NOT. clipper SET COLOR TO &stdvideo ENDI STOR .t. to an_error DO WHIL an_error DO CASE CASE mfname = ' ' @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'You must have a first name or initial' @ 3,58 GET mfname PICTURE '!XXXXXXXXXXXXXXXXXXX' READ CASE mmr = ' ' @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'Must have Mr., Mrs. Miss, Ms., Dr. Hon., etc.' @ 04,58 GET mmr READ CASE mdear = ' ' @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'Must have a salutation for Dear..... ' @ 15,13 GET mdear READ CASE MOD(AT(mcst,'&tstate'),2) = 0 @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'Company state abbreviation not correct' @ 10,44 GET mcst PICTURE '!!' READ CASE MOD(AT(mst,'&tstate'),2) = 0 @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'Home state abbreviation not correct ' @ 13,44 GET mst PICTURE '!!' READ CASE .NOT. (msend = 'Y' .OR. msend = 'N') @ 21,01 SAY SPACE(77) @ 22,01 SAY SPACE(77) @ 21,15 SAY 'Must answer "Y" or "N" to send letter to office ' @ 15,58 GET msend picture '!' READ OTHE STOR .f. TO an_error ENDC ENDD while an:error ENDI error RETU