Category : BASIC Source Code
Archive   : PIA88SRC.ZIP
Filename : CONFIG.BAS

 
Output of file : CONFIG.BAS contained in archive : PIA88SRC.ZIP
100 DEFINT A,G,I,K,M,N,P,S,T,U,W: DEFDBL B,C,D,L,O
101 DEFSNG E,F,H,J,Q,R,V,X,Y,Z
105 REM $INCLUDE: 'COMMON.BAS'
110 REM $INCLUDE: 'GETSTRN.BAS'
500 REM Read historical amounts from OLDAWBI.DAT
505 OPEN "I",1,"OLDAWBI.DAT"
510 PRINT " Reading historical amounts from OLDAWBI.DAT"
515 INPUT #1,N4: CLOSE #1
600 REM Read titles of assumptions from TITLES.DAT
605 OPEN "I",1,"TITLES.DAT"
610 PRINT " Reading titles of assumptions from TITLES.DAT"
615 FOR I1=1 TO 4: INPUT #1,E$(I1): W$(I1)=E$(I1): NEXT I1
620 CLOSE #1
700 REM Set titles of built-in assumptions
702 E$(5)="No increase beyond"+STR$(1949+N4)+" average wage"
703 E$(6)="Current POMS calculation (4-percent nominal wage increases)"
705 E$(7)="Proposed POMS calculation (1-percent real wage increases)"
710 E$(8)="Other assumptions (input from keyboard)"
715 W$(5)="No increase beginning with"+STR$(1951+N4)+" benefit increase"
716 W$(6)="Current POMS calculation (no future benefit increases)"
720 W$(7)="Proposed POMS calculation (no future benefit increases)"
725 W$(8)=E$(8)
1000 REM Read configuration
1005 GOSUB 5000
1018 REM Print configuration menu
1020 GOSUB 2600: PRINT " ";: GOSUB 9870
1025 PRINT STRING$(22," ");"Review or update configuration";
1030 PRINT STRING$(23," "): GOSUB 2700
1040 GOSUB 9860
1050 PRINT " Enter choice for review or update of configuration"
1051 PRINT " 0 to skip review of configuration"
1052 PRINT " 1 to review configuration"
1053 PRINT " 2 to update configuration"
1055 PRINT " > ";: K8=VAL(FNGETSTRN$(1))
1060 IF K8<0 OR K8>2 THEN BEEP: GOTO 1040
1065 GOSUB 9850: ON K8+1 GOTO 2400,1100,1068
1068 REM print warning
1070 GOSUB 2600: PRINT " ";: GOSUB 9870
1071 PRINT STRING$(33," ");"Warning!";STRING$(34," "): GOSUB 2700
1073 GOSUB 9850: PRINT " You are about to change the ";
1074 PRINT "configuration data file for this program."
1075 PRINT " This means that you will permanently alter the ";
1076 PRINT "prompts that will"
1077 PRINT " appear on the screen when you run the program (until";
1078 PRINT " you change the"
1080 PRINT " configuration again).": PRINT
1081 PRINT " There are eight program variables to be configured. If";
1082 PRINT " you enter a"
1083 PRINT " 0 for a configuration, that variable will appear with a";
1084 PRINT " menu choice"
1085 PRINT " when you run the PIA program. If you enter a positive ";
1086 PRINT "value, that": PRINT " variable will automatically be ";
1087 PRINT " given that value, without any menu"
1088 PRINT " choice offered": PRINT
1089 PRINT " There are also two hardware configurations to be set: ";
1090 PRINT " one for your"
1091 PRINT " printer and one for your monitor.": PRINT
1092 GOSUB 9860: PRINT " Do you want to continue? (y or n) > ";
1093 C$=FNGETSTRN$(1): GOSUB 9850
1094 IF LEN(C$)<=0 THEN BEEP: GOTO 1092
1095 GOSUB 2800: IF C$<>"Y" AND C$<>"N" THEN BEEP: GOTO 1092
1096 IF C$<>"Y" THEN 2200
1100 REM Display sex of worker
1105 GOSUB 2600: PRINT " ";: GOSUB 9870
1110 PRINT STRING$(24," ");"Sex-of-worker configuration";
1115 PRINT STRING$(24," "): GOSUB 2700: GOSUB 9850
1125 PRINT " Current sex-of-worker configuration:"
1130 IF A6=0 THEN PRINT " 0 (menu choice offered)": GOTO 1140
1135 PRINT " ";A6;"for ";A$(A6);" worker"
1140 IF K8=1 THEN GOSUB 3000: GOTO 1200
1145 GOSUB 9860
1150 PRINT " Enter choice for sex-of-worker configuration:"
1155 PRINT " 0 to request prompt for sex of worker"
1160 FOR K2=1 TO 2: PRINT " ";K2;"for ";A$(K2);" worker": NEXT K2
1165 PRINT " > ";: A6=VAL(FNGETSTRN$(1)): GOSUB 9850
1170 IF A6<0 OR A6>2 THEN BEEP: GOTO 1145
1200 REM Display type of benefit
1205 GOSUB 2600: PRINT " ";: GOSUB 9870
1210 PRINT STRING$(23," ");"Type-of-benefit configuration";
1215 PRINT STRING$(23," "): GOSUB 2700: GOSUB 9850
1225 PRINT " Current type-of-benefit configuration:"
1230 IF A5=0 THEN PRINT " 0 (menu choice offered)": GOTO 1240
1235 PRINT " ";A5;"for ";P$(A5);" benefit"
1240 IF K8=1 THEN GOSUB 3000: GOTO 1300
1245 GOSUB 9860
1250 PRINT " Enter choice for type-of-benefit configuration:"
1255 PRINT " 0 to request prompt for type of benefit"
1260 FOR K2=1 TO 3: PRINT " ";K2;"for ";P$(K2);" benefit": NEXT K2
1265 PRINT " > ";: A5=VAL(FNGETSTRN$(1)): GOSUB 9850
1270 IF A5<0 OR A5>3 THEN BEEP: GOTO 1245
1300 REM Display type of earnings
1305 GOSUB 2600: PRINT " ";: GOSUB 9870
1310 PRINT STRING$(22," ");"Type-of-earnings configuration";
1315 PRINT STRING$(23," "): GOSUB 2700: GOSUB 9850
1325 PRINT " Current type-of-earnings configuration:"
1330 IF A3=0 THEN PRINT " 0 (menu choice offered)": GOTO 1340
1335 PRINT " ";A3;"for ";Q$(A3)
1340 IF K8=1 THEN GOSUB 3000: GOTO 1400
1345 GOSUB 9860
1350 PRINT " Enter choice for type-of-earnings configuration:"
1355 PRINT " 0 to request prompt for type of earnings"
1360 FOR K2=1 TO 4: PRINT " ";K2;"for ";Q$(K2): NEXT K2
1365 PRINT " > ";: A3=VAL(FNGETSTRN$(1)): GOSUB 9850
1370 IF A3<0 OR A3>4 THEN BEEP: GOTO 1345
1400 REM Display type of survivor
1405 GOSUB 2600: PRINT " ";: GOSUB 9870
1410 PRINT STRING$(22," ");"Type-of-survivor configuration";
1415 PRINT STRING$(23," "): GOSUB 2700: GOSUB 9850
1425 PRINT " Current type-of-survivor configuration:"
1430 IF A4=0 THEN PRINT " 0 (menu choice offered)": GOTO 1440
1435 PRINT " ";A4;"for ";N$(A4)
1440 IF K8=1 THEN GOSUB 3000: GOTO 1500
1445 GOSUB 9860
1450 PRINT " Enter choice for type-of-survivor configuration:"
1455 PRINT " 0 to request prompt for type of survivor"
1460 FOR K2=1 TO 3: PRINT " ";K2;"for ";N$(K2): NEXT K2
1465 PRINT " > ";: A4=VAL(FNGETSTRN$(1)): GOSUB 9850
1470 IF A4<0 OR A4>3 THEN BEEP: GOTO 1445
1500 REM Display disability code
1505 GOSUB 2600: PRINT " ";: GOSUB 9870
1510 PRINT STRING$(25," ");"Disability configuration";
1515 PRINT STRING$(26," "): GOSUB 2700: GOSUB 9850
1525 PRINT " Current disability configuration:"
1530 IF T9=0 THEN PRINT " 0 (menu choice offered)": GOTO 1540
1535 PRINT " ";T9;"for ";X$(T9)
1540 IF K8=1 THEN GOSUB 3000: GOTO 1600
1545 GOSUB 9860
1550 PRINT " Enter choice for disability configuration:"
1555 PRINT " 0 to request prompt for disability code"
1560 FOR K2=1 TO 2: PRINT " ";K2;"for ";X$(K2): NEXT K2
1565 PRINT " > ";: T9=VAL(FNGETSTRN$(1)): GOSUB 9850
1570 IF T9<0 OR T9>2 THEN BEEP: GOTO 1545
1600 REM Display benefit increase assumptions
1605 GOSUB 2600: PRINT " ";: GOSUB 9870
1610 PRINT STRING$(22," ");"Benefit-increase configuration";
1615 PRINT STRING$(23," "): GOSUB 2700: GOSUB 9850
1625 PRINT " Current benefit-increase-assumption configuration:"
1630 IF A1=0 THEN PRINT " 0 (menu choice offered)": GOTO 1640
1635 PRINT " ";A1;"for ";W$(A1)
1640 IF K8=1 THEN GOSUB 3000: GOTO 1700
1645 GOSUB 9860
1650 PRINT " Enter choice for benefit-increase configuration:"
1655 PRINT " 0 to request prompt for benefit increase assumptions"
1660 FOR K2=1 TO W3: PRINT " ";K2;"for ";W$(K2): NEXT K2
1665 PRINT " > ";: A1=VAL(FNGETSTRN$(1)): GOSUB 9850
1670 IF A1<0 OR A1>W3 THEN BEEP: GOTO 1645
1700 REM Display average wage increase assumptions
1705 GOSUB 2600: PRINT " ";: GOSUB 9870
1710 PRINT STRING$(20," ");"Average-wage-increase configuration";
1715 PRINT STRING$(20," "): GOSUB 2700: GOSUB 9850
1725 PRINT " Current average-wage-increase-assumption configuration:"
1730 IF T3=0 THEN PRINT " 0 (menu choice offered)": GOTO 1740
1735 PRINT " ";T3;"for ";E$(T3)
1740 IF K8=1 THEN GOSUB 3000: GOTO 1800
1745 GOSUB 9860
1750 PRINT " Enter choice for average-wage-increase configuration:"
1755 PRINT " 0 to request prompt for average wage assumptions"
1760 FOR K2=1 TO W3: PRINT " ";K2;"for ";E$(K2): NEXT K2
1765 PRINT " > ";: T3=VAL(FNGETSTRN$(1)): GOSUB 9850
1770 IF T3<0 OR T3>W3 THEN BEEP: GOTO 1745
1800 REM Display projected wage base trigger
1805 GOSUB 2600: PRINT " ";: GOSUB 9870
1810 PRINT STRING$(21," ");"Projected-wage-base configuration";
1815 PRINT STRING$(21," "): GOSUB 2700: GOSUB 9850
1825 PRINT " Current projected-wage-base-assumption configuration:"
1830 IF A2=0 THEN PRINT " 0 (menu choice offered)": GOTO 1840
1835 PRINT " ";A2;"for ";R$(A2)
1840 IF K8=1 THEN GOSUB 3000: GOTO 1900
1845 GOSUB 9860
1850 PRINT " Enter choice for projected-wage-base configuration:"
1855 PRINT " 0 to request prompt for projected wage bases"
1860 FOR K2=1 TO 2: PRINT " ";K2;"for ";R$(K2): NEXT K2
1865 PRINT " > ";: A2=VAL(FNGETSTRN$(1)): GOSUB 9850
1870 IF A2<0 OR A2>2 THEN BEEP: GOTO 1845
1900 REM Display printer configuration
1905 GOSUB 2600: PRINT " ";: GOSUB 9870
1910 PRINT STRING$(27," ");"Printer configuration";
1915 PRINT STRING$(27," "): GOSUB 2700: GOSUB 9850
1925 PRINT " Current printer configuration:"
1930 IF G8>0 THEN 1935
1931 PRINT " 0 for printing on continuous paper": GOTO 1940
1935 PRINT " 1 for printing on cut sheets (stops at each page)"
1940 IF K8=1 THEN GOSUB 3000: GOTO 2000
1945 GOSUB 9860
1950 PRINT " Enter choice for printer configuration:"
1955 PRINT " 0 for printing on continuous paper"
1960 PRINT " 1 for printing on cut sheets (stops at each page)"
1965 PRINT " > ";: G8=VAL(FNGETSTRN$(1)): GOSUB 9850
1970 IF G8<0 OR G8>1 THEN BEEP: GOTO 1945
2000 REM Display color configuration
2005 GOSUB 2600: PRINT " ";: GOSUB 9870
2010 PRINT STRING$(28," ");"Color configuration";
2015 PRINT STRING$(28," "): GOSUB 2700: GOSUB 9850
2025 PRINT " Current color configuration:"
2030 IF K5>0 THEN 2035
2031 PRINT " 0 for monochrome monitor": GOTO 2040
2035 PRINT " 1 for color monitor"
2040 IF K8=1 THEN GOSUB 3000: GOTO 2075
2045 GOSUB 9860
2050 PRINT " Enter choice for color configuration:"
2055 PRINT " 0 for monochrome monitor"
2060 PRINT " 1 for color monitor"
2065 PRINT " > ";: K5=VAL(FNGETSTRN$(1)): GOSUB 9850
2070 IF K5<0 OR K5>1 THEN BEEP: GOTO 2045
2075 ON K8 GOTO 2200,2100
2100 REM Save to disk
2105 GOSUB 2600: PRINT " ";: GOSUB 9870
2110 PRINT STRING$(31," ");"Save to disk";STRING$(32," ")
2115 GOSUB 2700
2120 GOSUB 9860: PRINT " Do you want to save the updated values";
2125 PRINT " to disk? (y or n) > ";: C$=FNGETSTRN$(1): GOSUB 9850
2126 IF LEN(C$)<=0 THEN BEEP: GOTO 2120
2130 GOSUB 2800: IF C$<>"Y" AND C$<>"N" THEN BEEP: GOTO 2120
2135 IF C$<>"Y" THEN 2200
2140 OPEN "O",1,"CONFIG.DAT"
2145 PRINT " Writing configuration to CONFIG.DAT"
2150 PRINT #1,A6: PRINT #1,A5: PRINT #1,A3: PRINT #1,A4: PRINT #1,T9
2155 PRINT #1,A1: PRINT #1,T3: PRINT #1,A2: PRINT #1,G8: PRINT #1,K5
2160 CLOSE #1
2165 REM Initialize colors
2170 GOSUB 5100
2200 REM Print exit menu
2205 GOSUB 2600: PRINT " ";: GOSUB 9870
2210 PRINT STRING$(29," ");"Program selection";STRING$(29," ")
2215 GOSUB 2700
2220 GOSUB 9860: PRINT " Enter desired program:"
2225 PRINT " 0 to calculate a PIA"
2230 PRINT " 1 to review or update historical values"
2235 PRINT " 2 to store social security office address"
2240 PRINT " > ";: K8=VAL(FNGETSTRN$(1))
2245 IF K8<0 OR K8>2 THEN BEEP: GOTO 2220
2250 CLS: GOSUB 9850: ON K8+1 GOTO 2400,2265,2255
2255 PRINT " Loading address program; please wait..."
2260 CHAIN "ADDRESS"
2265 PRINT " Loading data-update program; please wait..."
2270 CHAIN "OLDAWBI"
2400 PRINT " Loading PIA data-input program; please wait..."
2405 CHAIN "PIAIN"
2600 REM Subroutine to clear screen and draw 75 hyphens
2605 CLS: GOSUB 9860: PRINT " ";STRING$(75,"-"): RETURN
2700 REM Subroutine to draw 75 hyphens and skip two lines
2705 GOSUB 9860: PRINT " ";STRING$(75,"-"): PRINT: PRINT: RETURN
2800 REM Subroutine to convert response to one-letter uppercase
2805 I4=ASC(C$): IF I4>96 THEN C$=CHR$(I4-32) ELSE C$=CHR$(I4)
2810 RETURN
3000 REM Subroutine to get a RETURN
3005 GOSUB 9860: PRINT: PRINT " Press RETURN to continue"
3010 C$=INKEY$: IF LEN(C$)<1 THEN 3010
3015 IF ASC(C$)<>13 THEN BEEP: GOTO 3010
3020 RETURN
5000 REM Subroutine to get configuration
5004 ON ERROR GOTO 5030
5005 OPEN "I",1,"CONFIG.DAT": GOSUB 9850
5006 ON ERROR GOTO 0
5010 PRINT " Reading configuration from CONFIG.DAT"
5015 INPUT #1,A6: INPUT #1,A5: INPUT #1,A3: INPUT #1,A4: INPUT #1,T9
5020 INPUT #1,A1: INPUT #1,T3: INPUT #1,A2: INPUT #1,G8: INPUT #1,K5
5025 CLOSE #1: RETURN
5030 REM Handle file error
5035 BEEP: GOSUB 9840: K6=66
5040 PRINT " Configuration file does not exist."
5045 END
5100 REM Subroutine to initialize colors
5105 FOR I1=0 TO 8
5110 IF K5>0 THEN K(I1,2)=K(I1,0) ELSE K(I1,2)=7
5115 NEXT I1: RETURN
9800 REM 1-line subroutines
9813 REM For Macintosh, $INCLUDE "COLOR.MAC"
9814 REM $INCLUDE: 'COLOR.BAS'
9900 GOSUB 9860: CLS: END
9999 REM CONFIG.BAS - 10/30/87 - 03:45 PM


  3 Responses to “Category : BASIC Source Code
Archive   : PIA88SRC.ZIP
Filename : CONFIG.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/