PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

PC-SIG Diskette Library (Disk #459)

[PCjs Machine "ibm5150"]

Waiting for machine "ibm5150" to load....

Information about “ASSORTED AGRICULTURE”

More tools for today's farmer!

The Department of Agriculture at the University of Minnesota has
prepared this wide-ranging collection of BASICA decision aids for farm
management.

Several conversion programs and calculators help the busy farmer with
yield analysis, gestation dates, harvest and storage costs, probable
feed requirements, maximum bid price for farmland, and more. Applicable
information for small to large-sized farms help you through the
intricacies of farm management problems and opportunities.
File Descriptions:

AUTOEXEC BAT  Automatic instructions to read this file.
ACRSCALC BAS  Analysis of federal depreciation computations.
FARMBID  BAS  Determines the maximum bid price for land or a farm.
DRYSTORE BAS  Analysis of harvest and storage cost & alternatives.
DATECALC BAS  Computes future (gestation) dates & calendars.
BESTCROP BAS  Price & yield analysis of crop choices (equal-margin).
FEEDPIGS BAS  Should I feed out a batch of feeder pigs?
MENU     BAS  Menu program for BASIC pgms on this disk.
FEEDVALU BAS  Given corn & SBM values, what's a feed worth?
FEEDSILO BAS  Calculates likely dairy feed in a silo given feed rate.
STEERBID BAS  Calculates equivalent FOB prices for fat steers at farm.
SOWINDEX BAS  Determines a sow index, relative to the group.
SDIR     COM  2 column directory.
SCROLLCK COM  Scroll lock - control with shift keys.
RUN      BAT  Batch file requests date, loads BASICA & starts MINNAIDS.
README   DOC  Documentation file.
READ     BAT  Batch file to provide instructions for SCROLLCK.COM.
PEARSON  BAS  Balances 1 ration nutrient from 2 feed sources.
USERDOCS BAS  Explains how to make hardcopy documentation of MINNAIDS.
ULOGO    BAS  University of Minnesota logo -- START HERE.
TIMEC    COM  Help program.

ACRSCALC.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF ACRSCALC 03/11/84 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
24 REM
25 REM
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35 REM  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70  DIM R(5,16),R1(6,12),R2(12),QQ$(7),B(16),C(16),E(16),F(16),LQ$(13)
80  DEF  FN R(X) =  INT (X + 0.5)
82  REM
83  REM    15 YR REAL ESTATE CLASS LIFE
90  GOSUB 2100
110  GOSUB 47300: GOSUB 46000: PRINT : GOSUB 38
120  REM
130  PRINT
132  GOSUB 140
135  GOTO 158
140  LQ$(1) = "PROPERTY CLASS LIVES OF 3 TO 15 YEARS ARE ALLOWED IN THIS MINN-AID"
142  LQ$(2) = "LONGER CLASS LIVES ARE NEVER ECONOMIC EVEN WITH OUT CURRENT TAX LIABILITIES."
144  LQ$(3) = " " : LQ$(4) = "   FINANCIAL LOGIC SAYS TO PICK THE HIGHEST PRESENT VALUED TAX OPTION."
146  LQ$(5) = "IF EARLY DISPOSAL IS PLANNED, ANY TAX COSTS SHOULD ALSO BE CONSIDERED."
147  LQ$(6) = " "
148  LQ$(7) = "THIS VERSION IS CONSISTENT WITH THE LAW AS OF 1983.  CARE IS NEEDED TO INSURE"
149  LQ$(8)="CURRENCY IN LATER YEARS AS THE TAX CODE IS CHANGED."
150  FOR I = 1 TO 8
152 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 154
153 PRINT LQ$(I) : IF PR$ ="Y" THEN LPRINT LQ$(I)
154 NEXT I
155 IF PQ$ = "Y" THEN RETURN
156 GOSUB 49000 : RETURN
158 REM
160  IF S9 = 5 THEN  GOSUB 4000
170  IF S9 = 4 THEN  GOSUB 5000
180  GOSUB 38
190  REM     A1 = TAX YEAR OF CALCULATIONS MODIFY AS THE YEARS GO BY. ALSO NOTE THAT THE CALCULATIONS MUST REDUCE BASIS BY 50
200 A1 = 1984
202 A3 = AI: REM    AI = ENTERED BASIS; A3 = AS USED.
204 CR = 0.08: IF A4 = 3 THEN CR = 0.04: REM   UNADJUSTED BASIS - ITC
206  IF A4 > 12 THEN  GOSUB 1300
210  REM    DEFAULT SECTION 1245 1/2 YR PRORATION.
220 A5 = 0.5
225  GOSUB 500
230  IF S9 = 4 THEN 336
240  PRINT
245  IF A3 <  > AI THEN 390
250  GOSUB 41: PRINT "'0' = QUIT; '1' = ANALYZE NEW DATA; '2' = DISCOUNT TAX SAVINGS; WHICH";
260  INPUT A9
270 REM S9 = 5
280  PRINT : GOSUB 38
290  IF A9 = 1 GOTO 130
300  IF A9 <  = 0 THEN  GOTO 42900
310  IF A9 > 2 THEN 250
320  IF S9 = 4 THEN 336
330  GOSUB 7000
332  GOTO 350
336  GOSUB 8000
340  REM    DISCOUNTS BEGIN IN 2ND YEAR..ASSUMES THAT TAX SAVINGS ARE AVAILABLE AT THE TIME THE TAX SCHEDULE OPTIONS ARE MADE
350  GOSUB 38
360 TR = T1 * 0.01
370 TN = T3 * 0.01
380 DR = D2 * 0.01
390  GOSUB 2700
400  GOSUB 2500
402 IF FLAG = 5 THEN FLAG = 0 : GOSUB 49000 :GOTO 110
405  IF A3 <  > AI THEN 250
410 CR = 0.09999999: IF A4 = 3 THEN CR = 0.06
415  GOSUB 49010
420 A3 = AI - (0.5 * CR * AI)
425  PRINT SPC(20)"ASSUMING A REDUCED BASIS & FULL I.T.C.,":PRINT
430  GOTO 225
480  REM   END MAIN CONTROLING PROGRAM PROCEDURE ------
490  REM  ----------------------------------------
500  REM   BEGIN ACRS CALC & DISPLAY RESULTS PROCEDURAL SUB -----
510 A6 = A3 / A4
520  REM    10 YEAR CLASS LIFE IS BASICLY REAL ESTATE
525  IF A4 < 15 THEN 580
530  REM     SET A5 = PRORATION FACTOR FOR REAL ESTATE OPTIONS
540 A5 = (13 - A2) / 12
550  REM    A6 = FULL YEAR STRAIGHT LINE ACCRS
580 Y = 0
590  REM    STRAIGHT LINE CARRYOVER
610  FOR J = 1 TO A4 + 1
620 B(J) = A3 * R(IK,J) * 0.01
630 C(J) = A6 * A5 + Y
640  IF J = A4 + 1 THEN C(J) = Y
650 Y = A6 * (1 - A5)
660  NEXT J
670  REM
710  IF A4 = 12 THEN  GOTO 920
720  PRINT SPC(20)"FOR A ";L$;" WITH A $";A3;" BASIS"
730  PRINT
740  PRINT SPC(20)"TAX YEAR  REGULAR ACRS   YEAR END"
750  PRINT SPC(20)"             AMOUNT     BOOK VALUE"
760  PRINT
770 F1 =  FN R(B(1))
780 F2 = A3 - F1
790 E(1) = F2
800 B(1) = F1
810  PRINT  SPC(22);A1;TAB(35); F1;TAB(48);F2
820 A7 = 0
830  IF A4 = 15 AND A2 > 2 THEN A7 = 1
840  FOR J = 2 TO A4 + A7
850  IF J = A4 + A7 THEN 880
860 F1 =  FN R(B(J))
870 F2 = F2 - F1: GOTO 885
880 F1 = F2:F2 = 0
885 B(J) = F1:E(J) = F2
890  PRINT  SPC(22);A1 + J - 1; TAB(35); F1; TAB(48); F2
900  NEXT J
910  IF A4 > 5 THEN  GOSUB 49010
920  GOSUB 1710
930  GOSUB 49010
932  RETURN
935  REM   END ACRS CALCULATING PROCEDURE
936  REM   ---------------------------------------
1300  REM    SUBROUTINE TO COMP ER(5,J) ARRAY FOR 15 YR OPTION
1305 T = 0
1310 J = A2
1315  FOR I1 = 1 TO 6
1320 R(5,I1) = R1(I1,J)
1325 T = T + R1(I1,J)
1330  NEXT I1
1332 R(5,16) = R2(J)
1334 T = T + R2(J)
1335 T = 55 - T
1340  REM    TAX YR. ANNUAL % FOR INTERMEDIATE YEARS
1345  FOR J = 7 TO 7 + T
1350 R(5,J) = 6
1355  NEXT J
1357  IF 7 + T = 15 THEN  RETURN
1360  FOR J = 8 + T TO 15
1365 R(5,J) = 5
1370  NEXT J
1387  RETURN
1390  REM    ENDSUB TO PLACE DATA IN R(5,J) LOCATIONS....
1395  REM   ---------------------------------------
1700  REM   BEGIN STRAIGHT LINE CALCULATING PROCEDURE SUB
1710  IF A4 < 10 THEN 1760
1720  PRINT : PRINT "PRESS THE 'RETURN' KEY TO SEE THE       STRAIGHT LINE TABLE. ";
1730 GOSUB 40610
1740  PRINT
1750  PRINT SPC(20)"FOR A ";L$
1760  PRINT
1770  PRINT SPC(20)"TAX YEAR    STRAIGHT     YEAR END"
1780  PRINT SPC(20)"              LINE      BOOK VALUE"
1790  PRINT
1800 F1 =  FN R(C(1))
1810 X = A3 - F1
1820 F3 = A3 - F1
1830 F4 = A3 - F2
1832 C(1) = F1:F(1) = X
1840  PRINT  SPC(22);A1;TAB(35);F1;TAB(48); X
1850  FOR J = 2 TO A4 + 1
1860  IF J = A4 + 1 THEN 1910
1870 F1 =  FN R(C(J))
1880 X = X - F1
1890  IF X > 0 THEN 1925
1900 F1 = F1 - X:X = 0: GOTO 1925
1910 F1 = X:X = 0
1920  IF X < 0 THEN X = 0
1925 C(J) = F1:F(J) = X
1930  PRINT  SPC(22);A1 + J - 1;TAB(35); F1;TAB(48); X
1940  IF X <  = 0 THEN  RETURN
1950  NEXT J
1960  IF PR$ = "Y" GOSUB 3000
1970  RETURN
1980  REM   END STRAIGHT LINE CALCULATING PROCEDURE ---
1990  REM  ----------------------------------------
2000  REM   BEGIN INITIAL MESSAGE PROCEDURAL SUB ------
2010  LQ$(1) = " ": LQ$(2) = "            ACRS CALC...             "
2020  LQ$(3)= " " : LQ$(4) = "  ACCELERATED COST RECOVERY SYSTEM"
2030  LQ$(5) = " CALCULATIONS AS SPECIFIED IN THE TAX"
2040  LQ$(6) = " RECOVERY ACT OF 1981.  THE PROGRAM  "
2050  LQ$(7) = " CONTAINS A DISCOUNT TO PRESENT VALUE"
2060  LQ$(8) = " AT THE TIME THE TAX CHOICE IS MADE."
2070  LQ$(9) = " HAS 1983 BASIS & INVESTMENT OPTIONS."
2072  LQ$(10) = " "
2074  LQ$(11) = "FIGURES TAX SCHEDULE VALUES & IF ASKED "
2076  LQ$(12)= "DISCOUNTS THEM TO THEIR PRESENT VALUES"
2078  LQ$(13)= "IN ORDER TO HELP PICK THE BEST OPTION."
2080  FOR I = 1 TO 13
2082 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 2086
2084 PRINT SPC(20);LQ$(I)  : IF PR$ = "Y" THEN LPRINT LQ$(I)
2086 NEXT I
2088 IF PQ$ = "Y" THEN RETURN
2089 GOSUB 49000 : RETURN
2090  REM   END INITIAL SCREEN PROCEDURE
2095  REM   ---------------------------------------
2100 QQ$(1) = "DESCRIBE THE ASSET/ASSET CLASS... "
2110 QQ$(2) = "ENTER ACRS ORGINAL TAX BASIS ($). "
2120 QQ$(3) = "ACRS PROPERTY CLASS LIFE IN YEARS "
2130 QQ$(4) = "ENTER MONTH OF 1ST USE IN TAX YR. "
2140  REM     ACRS CALC...ACCELERATED COST RECOVRY SYSTEM CALCULATIONS AS SPECIFIED IN THE TAX RECOVRY ACT OF 1981.
2150 QQ$(5) = "CURRENT MARGINAL INC. TAX RATE(%) "
2160 QQ$(6) = "TAX RATE FOR LATER YEARS......(%) "
2170 QQ$(7) = "INTEREST RATE TO DISCOUNT BY..(%) "
2180 IF PQ$ = "Y" THEN GOSUB 49100:RETURN
2200  FOR I = 1 TO 3: READ R(1,I): NEXT I
2210  REM    3 YR CLASS LIFE DATA
2220  DATA    25,38,37
2230  FOR I = 1 TO 5: READ R(2,I): NEXT I
2240  REM    5 YR CLASS LIFE DATA
2250  DATA    15,22,21,21,21
2260  FOR I = 1 TO 10: READ R(3,I): NEXT I
2270  REM    10 YR CLASS LIFE DATA
2280  DATA    8,14,12,10,10,10,9,9,9,9
2300  REM    READ R1(6 YEAR & 12 MO.) TABLE FOR 15 YEAR REAL ESTATE OPTION
2310  DATA    12,11,10,9,8,7,6,5,4,3,2,1
2320  DATA    10,10,11,11,11,11,11,11,11,11,11,12
2330  DATA    9,9,9,9,10,10,10,10,10,10,10,10
2340  DATA    8,8,8,8,8,8,9,9,9,9,9,9
2350  DATA    7,7,7,7,7,7,8,8,8,8,8,8
2360  DATA    6,6,6,6,7,7,7,7,7,7,7,7
2370  FOR I = 1 TO 6
2380  FOR J = 1 TO 12
2390  READ R1(I,J)
2400  NEXT J
2405 NEXT I
2410  REM   END 15 YEAR ACRS BASIC DATA SUB--------
2420  FOR J = 1 TO 12
2430  READ R2(J)
2440  DATA    0,0,1,1,2,2,3,3,4,4,4,5
2450  REM
2460  NEXT J
2470  RETURN
2480  REM   END INITIAL DATA SUB PROCEDURE---------
2485  REM   ---------------------------------------
2490  REM   BEGIN DISCOUNT ANALYSIS DISPLAY SUB----
2500 PRINT "   PRESENT VALUE ANALYSIS OF THE COST RECOVERY ALTERNATIVES"
2502 PRINT
2504  PRINT USING "\                           \ WITH A $$####### BASIS,";L$;A3
2506  PRINT : PRINT USING "#### TAX RATE = ###%";A1;TN * 100;
2510  PRINT USING " - LATER YEARS = ###%";TR * 100
2520  PRINT USING "DISCOUNT TO PRESENT VALUE RATE = ###.#% FOR A ## YEAR CLASS LIFE";DR*100;A4
2530 PRINT
2540  PRINT "PRESENT VALUE OF ACCELERATED COST RECOVERY SCHEDULE (1981-19?? RULES)"
2550  PRINT : PRINT "       REGULAR ACRS:       STRAIGHT LINE OPTION:"
2560  PRINT USING "         $$######              $$######";B2;C2
2562 PRINT
2565 B1 = 0
2570  IF A4 > 12 THEN 2620
2580  PRINT USING "ADD ##.# ";CR * 100;:PRINT "% INVESTMENT CREDIT AND THE IMPACT WOULD BE"
2590  IF A4 < 5 GOTO 2630
2600 B1 = FNR(CR * AI)
2610  REM    10% ITC FOR 5+ YRS CLASS LIFE
2615  PRINT USING "         $$######              $$######";B1;B1
2620  PRINT : PRINT "PRESENT VALUE OF TAX SAVINGS FOR COST RECOVERY OPTION SELECTION PURPOSES"
2625  PRINT USING "TOTAL PV $$######              $$######";B2;B1+C2
2630  PRINT
2635 V1 =  FN R((B1 + B2) / (1 + DR))
2640 V2 =  FN R((B1 + C2) / (1 + DR))
2645  PRINT "- FOR PRE-PURCHASE INVESTMENT ANALYSIS  PURPOSES THE PRESENT VALUE IS ;"
2650  PRINT USING "         $$######              $$######";V1;V2
2652 IF PR$ ="Y" THEN GOSUB 3500
2655 IF S9 = 4 THEN FLAG = FLAG +1
2656 IF FLAG > 1.5 THEN FLAG = 5
2670  RETURN
2680 REM -------------------------------------------------
2690  REM   ---------------------------------------
2700  REM   BEGIN PROCEDURAL SUB TO DISCOUNT TO PRESENT VALUE ----
2710 B2 = B(1) * TN
2720 C2 = C(1) * TN
2730 B2 = B2 + B(2) * TR / (1 + DR)
2740 C2 = C2 + C(2) * TR / (1 + DR)
2750  FOR I = 3 TO A4 + 1
2760 B2 = B2 + B(I) * TR * (1 / (1 + DR)) ^ (I - 1)
2770 C2 = C2 + C(I) * TR * (1 / (1 + DR)) ^ (I - 1)
2780  NEXT I
2790  IF A4 = 12 THEN B2 = 0
2800  IF PR$ = "Y" THEN  GOSUB 3000
2810  RETURN
2820  REM   END DISCOUNT CALCULATION PROCEDURE
2830  REM   ---------------------------------------
3000  REM   BEGIN PRINTED RESULTS PROCEDURAL SUB---
3010  GOSUB 39410
3020 LPRINT : LPRINT
3022  PRINT : PRINT
3025 LPRINT " FOR A ";L$;" WITH A ";A1;" TAX BASIS OF $";A3: PRINT
3030 LPRINT "       REGULAR ACRS OPTION   STRAIGHT LINE OPTION"
3040 LPRINT "TAX   AMOUNT   END OR YEAR   AMOUNT   END OF YEAR"
3050 LPRINT "YEAR  ALLOWED  BOOK VALUE    ALLOWED  BOOK VALUE"
3060  FOR J = 1 TO A4 + 1
3070 LPRINT USING "####";A1+J-1;
3080  IF J < A1 - 1 THEN 3110
3090 LPRINT  SPC( 20);
3100  GOTO 3120
3110 LPRINT USING " #######  ##########";B(J);E(J);
3120 LPRINT USING " ######### ##########";C(J);F(J)
3130  NEXT J
3140 LPRINT
3150 RETURN
3160  REM   END PRINTED RESULT PROCEDURE
3170  REM   ----------------------------------------
3490  REM   BEGIN DISCOUNT ANALYSIS PRINTER SUB----
3500 LPRINT "   PRESENT VALUE ANALYSIS OF THE COST RECOVERY ALTERNATIVES"
3502 LPRINT
3504 LPRINT USING "\                           \ WITH A $$####### BASIS,";L$;A3
3506 LPRINT : PRINT USING "#### TAX RATE = ###%";A1;TN * 100;
3510 LPRINT USING " - LATER YEARS = ###%";TR * 100
3520 LPRINT USING "DISCOUNT TO PRESENT VALUE RATE = ###.#% FOR A ## YEAR CLASS LIFE";DR*100;A4
3530 LPRINT
3540 LPRINT "PRESENT VALUE OF ACCELERATED COST RECOVERY SCHEDULE (1981-19?? RULES)"
3550 LPRINT : PRINT "       REGULAR ACRS:       STRAIGHT LINE OPTION:"
3560 LPRINT USING "         $$######              $$######";B2;C2
3562 LPRINT
3565 B1 = 0
3570  IF A4 > 12 THEN 3620
3580 LPRINT USING "ADD ##.# ";CR * 100;:PRINT "% INVESTMENT CREDIT AND THE IMPACT WOULD BE"
3590  IF A4 < 5 GOTO 3630
3600 B1 = FNR(CR * AI)
3610  REM    10% ITC FOR 5+ YRS CLASS LIFE
3615 LPRINT USING "         $$######              $$######";B1;B1
3620 LPRINT : PRINT "PRESENT VALUE OF TAX SAVINGS FOR COST RECOVERY OPTION SELECTION PURPOSES"
3625 LPRINT USING "TOTAL PV $$######              $$######";B2;B1+C2
3630 LPRINT
3635 V1 =  FN R((B1 + B2) / (1 + DR))
3640 V2 =  FN R((B1 + C2) / (1 + DR))
3645 LPRINT "- FOR PRE-PURCHASE INVESTMENT ANALYSIS  PURPOSES THE PRESENT VALUE IS ;"
3650  PRINT USING "         $$######              $$######";V1;V2
3660 RETURN
3670 REM ------END PRINTED PV ANALYSIS SUB --------------
4000  REM   BEGIN REGULAR INPUT PROCEDURE OPTION
4020 CH = 36
4080  IF PQ$ = "Y" THEN  GOSUB 49110: RETURN
4090  REM   GOSUB 49100 TO PRINT A INPUT FORM ON PAPER.  (K2 = NO. OF QUESTIONS)
4100  GOSUB 38: GOSUB 51
4110  PRINT "<RETURN>=USE LAST KEY-IN TO QUESTION"
4120  GOSUB 50
4130  GOSUB 39
4140  PRINT
4150  PRINT QQ$(1);L$
4160  PRINT
4170  PRINT QQ$(2);AI
4180  PRINT
4190  GOSUB 5310
4200  PRINT QQ$(3);A4
4210  PRINT
4220  PRINT QQ$(4);A2
4230  IF K2$ = "N" THEN  GOTO 4480
4240  GOSUB 41: GOSUB 49910
4250  GOSUB 40210
4260 LQ = 1:LN = 2: GOSUB 40
4270  GOSUB 40230: IF ZN$ <  > "" THEN L$ = ZN$
4280  GOSUB 40210
4290 LQ = 2:LN = 4: GOSUB 40
4300  GOSUB 40000: IF ZN$ <  > "" THEN AI = ZN
4310  GOSUB 40210
4320 LQ =3:LN = 13: GOSUB 40
4330  GOSUB 40000: IF ZN$ <  > "" THEN A4 = ZN
4340 LO = 3:HI = 15
4350  IF A4 < LO OR A4 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 4320
4360  GOSUB 40210
4370 IK = 0
4380  IF A4 = 3 THEN IK = 1
4390  IF A4 = 5 THEN IK = 2
4400  IF A4 = 10 THEN IK = 3
4410  IF A4 = 12 THEN IK = 4
4420  IF A4 = 15 THEN IK = 5
4430  IF IK > 0 THEN 4460
4440  GOSUB 41: PRINT  CHR$ (7): GOSUB 51: PRINT "ENTERED CLASS LIFE IS NOT ALLOWED.";: GOSUB 50
4450  Z$ = INPUT$(1) :GOTO 4310
4460  IF A4 < 12 GOTO 4530
4470  IF Z$ = "N" THEN CX = 1:CY = 20: GOSUB 42: LOCATE 16,1:GOTO 4220
4480 LQ = 4:LN = 15: GOSUB 40
4490  GOSUB 40000: IF ZN$ <  > "" THEN A2 = ZN
4500 LO = 1:HI = 12
4510  IF A2 < LO OR A2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 4480
4520  GOTO 4535
4530 LN = 20:CX = 1:CY = CV + LN: GOSUB 42
4532  PRINT "(A 1/2 YEAR CONVENTION RULE  APPLIES.)"
4535  GOSUB 40210:GOSUB 41
4540  GOSUB 51
4550  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N OR <CNTL-Q> = QUIT ENTIRE ANALYSIS";
4570  GOSUB 50
4580 GOSUB 40610
4600  IF Z$ = QE$ THEN 42900
4610  IF Z$ = "N" THEN CX = 1:CY = CY: GOSUB 42: GOSUB 45: GOTO 4250
4620  IF Z$ <  > "Y" THEN 4535
4625 LOCATE ,,0:GOSUB 48700
4630  RETURN
4640  REM   END DATA INPUT PROCEDURE -------
4650  REM  ---------------------------------
5000  REM   BEGIN 1ST 4 DATA ITEMS AUTO ENTRY (S9 = 4-OPTION)----
5010  GOSUB 38: GOSUB 51
5020 L$ = " PLOW"
5030 AI = 10000
5040 A4 = 5
5050 A2 = 7
5060 IK = 2
5070  PRINT "<RETURN>=USE LAST KEY-IN TO QUESTION"
5080  GOSUB 50
5090  GOSUB 39
5100  PRINT
5110  PRINT QQ$(1);L$
5120  PRINT
5130  PRINT QQ$(2);AI
5140  PRINT
5150  GOSUB 5310
5160  PRINT QQ$(3);A4
5170  PRINT
5180  PRINT QQ$(4);"(NOT USED)"
5190  GOSUB 49000
5200  RETURN
5210  REM   END AUTO DATTA ENTRY PROCEDURE---------
5220  REM   ---------------------------------------
5300  REM   BEGIN SPECIAL SCREEN MESSAGE PROCEDURAL SUB -----
5310  LQ$(1) = "AUTOS, TRUCKS & SWINE HAVE A 3 YEAR; FARM MACHINERY, CATTLE, SHEEP & SINGLE"
5320  LQ$(2) =  "PURPOSE AGRICULTURAL STRUCTURES A 5 YR. (12 YR. OPTIONAL) CLASS LIFE."
5325  LQ$(3) = " "
5330  LQ$(4) = "GENERAL PURPOSE REAL ESTATE A 15 YEAR LIFE (10 YEARS FOR MOBILE HOMES.)"
5340  LQ$(5) = " "  : LQ$(6)= "THERE ARE 25, 35,AND 45 YR. OPTIONS BUT THESE ARE UNECONOMIC OPTIONS."
5350  LQ$(7) = " "
5354  FOR I = 1 TO 7
5356 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 5360
5358 PRINT LQ$(I)
5360 NEXT I : IF S9 = 1 THEN GOSUB 49000
5365 RETURN
5370  REM   END SPECIAL SCREEN PRINT PROCEDURE------
5380  REM   ---------------------------------------
7000  REM   BEGIN 2ND SCREEN INPUT PROCEDURE ------
7040 CH = 54
7140  IF PQ$ = "Y" THEN  GOSUB 49110: RETURN
7160  REM   GOSUB 49100 TO PRINT A INPUT FORM ON PAPER.  (K2 = NO. OF QUESTIONS)
7180  GOSUB 38: GOSUB 51
7200  LOCATE 1,20 : PRINT "<RETURN>=USE LAST KEY-IN TO QUESTION"
7220  GOSUB 50
7240  GOSUB 39
7260  PRINT
7280  PRINT TAB(20);:PRINT QQ$(5);T3
7300  PRINT
7320  PRINT TAB(20);:PRINT QQ$(6);T1
7340  PRINT
7360  PRINT TAB(20);:PRINT QQ$(7);D2
7370 IF S9 = 4 THEN GOSUB 49000 : GOTO 7900
7380  GOSUB 41: GOSUB 49910
7385  GOSUB 40210
7400 LQ = 5:LN = 2: GOSUB 40
7420  GOSUB 40000: IF ZN$ <  > "" THEN T3 = ZN
7440 LO = 0:HI = 100
7460  IF T3 < LO OR T3 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 7400
7480  GOSUB 40210
7500 LQ = 6:LN = 4: GOSUB 40
7520  GOSUB 40000: IF ZN$ <  > "" THEN T1 = ZN
7540 LO = 0:HI = 100
7560  IF T1 < LO OR T1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 7500
7580  GOSUB 40210
7600 LQ = 7:LN = 6: GOSUB 40
7620  GOSUB 40000: IF ZN$ <  > "" THEN D2 = ZN
7640 LO = 0:HI = 100
7660  IF D2 < LO OR D2 > HI THEN O TO  GOSUB 40150: GOSUB 40: GOTO 7600
7680  REM
7700  GOSUB 40210:GOSUB 41
7720  GOSUB 51
7740  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N OR <CNTL-Q> = QUIT ENTIRE ANALYSIS) ";
7780  GOSUB 50
7800 GOSUB 40610
7840  IF Z$ = QE$ THEN 42900
7860  IF Z$ = "N" THEN GOSUB 41: GOSUB 45: GOTO 7385
7880  IF Z$ <  > "Y" THEN 7700
7890 GOSUB 48700 : LOCATE ,,0
7900  RETURN
7910  REM   END 2ND INPUT SCREEN PROCEDURE
7920  REM   ---------------------------------------
7990  REM   BEGIN AUTO INPUT FOR S9 = 4 PROCEDURAL SUB -------
8000  GOSUB 38: GOSUB 51
8001 T1 = 42
8002 D2 = 15
8003 T3 = 37
8010  LOCATE ,20 : PRINT "<RETURN>=USE LAST KEY-IN TO QUESTION"
8020  GOSUB 50
8030  GOSUB 39
8040  PRINT
8045 LOCATE 3,20
8050  PRINT QQ$(5);T3
8060  PRINT
8065 LOCATE 5,20
8070  PRINT QQ$(6);T1
8080  PRINT
8085 LOCATE 7,20
8090  PRINT QQ$(7);D2
8093  GOSUB 49000
8095  RETURN
8096  REM   END 2ND AUTO INPUT PROCEDURE
8097  REM   ---------------------------------------
38900 REM
38999 REM
39400  REM   SUBS TO TOGGLE PRINTER
39410  IF PR$ <  > "Y" THEN  RETURN
39420  LOCATE 20,20 :PRINT "TURN PRINTER ON & PRESS ANY KEY ";: Z$ = INPUT$(1) : IF Z$ < > "" THEN RETURN
39425  GOTO 39420
39440 PRINT "THE PRINTER IS NOT BEING USED ?" : RETURN
39450  REM   ---------------------------------------
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39485 RETURN
39490  REM  ----------------------------------------
39510  PRINT "WILL YOU USE A PRINTER (Y OR N) ";
39520  INPUT PR$: IF PR$ = ES$ THEN 38900
39530 PR$ =  LEFT$ (PR$,1)
39540  RETURN
39550  REM  ----------------------------------------
39560  REM   END PROCEDURE TO USE ? PRINTER
39570  REM
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$) : RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE (";ZN") SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40400  REM   PROCEDURE TO PRINT LENGTH OF DATA PROMPT (REQUIRED OR MAXIMUM
40405  REM   PROPER USE REQUIRES POST GENBASIC CODING OF WL & FL'S
40410  PRINT  LEFT$ (SQ$,WL);
40420  IF FL > 0 THEN  PRINT "."; LEFT$ (SQ$,FL);
40430 CX = CH:CY = CV + LN: GOSUB 42
40440  RETURN
40450  REM   END PROCEDURAL SUB
40460  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 110
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN GOTO 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45540 EL = ERL: EC = ERR
45550 CLS:LOCATE 12,12:GOSUB 51:PRINT CHR$(7):PRINT CHR$(7): PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45560 PRINT "  REFER TO YOUR USER'S MANUAL":GOSUB 50
45565 PRINT : PRINT"DO NOT PANIC":PRINT "It is possible to recover from certain errors without losing any data.": PRINT "DO NOT EXIT FROM THIS PROGRAM.  Continue on for instructions."
45570 PRINT
45580 IF EC <53 OR EC > 72 THEN 45615
45590 IF EC > 63 THEN 45610
45600 SS = EC - 52 : ON SS GOTO 45620,45615,45615,45615,45630,45615,45615,45615,45640,45615,45615
45610 SS = EC - 63 : ON SS GOTO 45615,45615,45615,45655,45615,45615,45650,45660,45665
45615 EM$ = "SEE BASIC MANUAL PAGES A3 TO A11" : RM$ = "NO RECOVERY POSSIBLE. RERUN FROM BEGINNING." : FLAG = 23 : GOTO 45670
45620 EM$ = "FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45630 EM$ = "DEVICE I/O ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45640 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45650 EM$ = "DISK WRITE PROTECT" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45655 EM$ = "TOO MANY FILES" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45660 EM$ = "DISK NOT READY" : RM$ = "DRIVE DOOR OPEN,NO DISK IN DRIVE?":GOTO 45670
45665 EM$ = "DISK MEDIA ERROR":RM$ = "USE A DIFFERENT DISK."
45670 LOCATE 5,5 :PRINT"ERROR #";EC;"  ";EM$
45675 LOCATE 7,5: PRINT"REMEDY/SUGGESTION:  ";RM$
45677 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 LOCATE 10,5 : PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": ZZ$ = INPUT$(1)
45685 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 2000
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 2000
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   12/10/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47092  PRINT SPC(20)"!           PROJECT 14-036            !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   12/10/83              IBM - PC    !"
47350  PRINT SPC(20)"!           ACRS CALC...              !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!      ACCELERATED COST RECOVERY      !"
47380  PRINT SPC(20)"! SYSTEM CALCULATIONS AS SPECIFIED IN !"
47390  PRINT SPC(20)"!    THE TAX RECOVERY ACT OF 1981     !"
47397  PRINT SPC(20)"!   AND THE TAX EQUITY ACT OF 1982    !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
48030  LPRINT "!   12/10/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   12/10/83              (IBM - PC)  !"
48310  LPRINT "!              ACRS CALC              !"
48320  LPRINT "!      ACCELERATED COST RECOVERY      !"
48330  LPRINT "! SYSTEM CALCULATIONS AS SPECIFIED IN !"
48340  LPRINT "!    THE TAX RECOVERY ACT OF 1982     !"
48350  LPRINT "!   AND THE TAX EQUITY ACT OF 1982    !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48750 REM*** CONVERTS INPUT OF LOWER CASE TO UPPER CASE
48755 IF K2$ = "" THEN RETURN
48760 I% = ASC(K2$)
48770 IF I% > 96 AND I% < 123 THEN K2$ = CHR$(I%-32)
48775 Z$ = K2$
48780 RETURN
48790 IF Z$ = "" THEN RETURN
48793 K2$ = Z$
48795 I% = ASC(Z$) : GOTO 48770
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50:GOSUB 49007:RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005 REM IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "?????? PUT A TITLE HERE"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149 K2 = 7
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105 REM
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50170
50108  GOTO 50300
50110  LQ$ = "Describe the asset or asset class in words in less than 20 letters"
50119  GOTO 50300
50120  LQ$ = "Enter the adjusted basis for the asset to be cost recovered."
50129  GOTO 50300
50130  LQ$ = "Enter the appropriate ACRS asset class life in years (3,5,10, or 15)."
50139  GOTO 50300
50140  LQ$ = "Enter the month the real asset was put in service (1 =Jan...12=Dec. etc."
50149  GOTO 50300
50150  LQ$ = "Current marginal income tax rate (%) = federal + S.S. or S.E. + adl.state rate"
50159  GOTO 50300
50160  LQ$ = "Projected marginal tax rate (typical) for the remainder of the tax life (%)"
50169  GOTO 50300
50170  LQ$ = "Rate by which to discount future tax savings to calculate present value (%)"
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : GOSUB 40610 : RETURN
50320  REM ----------------------------------------
53025 REM ------------------------------------------

BESTCROP.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF BESTCROP 03/11/84 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70 DIM QQ$(10) : DIM LQ$(21)
72 DIM F(5),G(5),L(5),R(5),E(5)
74 K2 = 10:CH = 64 : S = 1
80 GOSUB 1500
90  GOSUB 47300
100  GOSUB 46000
110 REM
120  GOSUB 1557
130  IF C1 + C <  = 0 THEN  GOSUB 1780
131  IF C > 0! THEN 135
132 C = (B * B1 - E1 + E2) / C1
133 C =  INT (C * 100 + 0.005000001) / 100
135  IF C1 > 0! THEN 139
137 C1 = (B * B1 - E1 + E2) / C
138 C1 =  INT (C1 * 100 + 0.005000001) / 100
139  REM      END OF INPUT
140  GOSUB 38
150 REM ??????? LN = 12 : IF PR$ = "Y" THEN LN = 9
160 IF PR$ <> "Y"  THEN 166
162 LPRINT "A TABLE OF BREAK-EVEN PRICES & YIELDS FOR THE TWO CROPS IN THE ANALYSIS"
163 LPRINT
164 LPRINT B$;: LPRINT SPC(16);C$;" PRICE ($)/";W$
165 LPRINT USING "YIELD = ####.##"; B;
166  PRINT "A TABLE OF BREAK-EVEN PRICES & YIELDS FOR THE TWO CROPS IN THE ANALYSIS"
167 PRINT
170 PRINT B$;:PRINT SPC(16);C$;" PRICE ($)/";W$
175 M = 0!
177 PRINT USING "YIELD = ####.##"; B;
179 LOCATE 5,14
180  FOR J = 1 TO 5
185 F(J) = C1 + C1 * (M - 0.2) + 0!
190 M = M + 0.1
202 IF PR$ = "Y" THEN LPRINT USING "###.##         ";F(J);
203 IF J= 3 THEN GOSUB 51:PRINT USING "###.## ";F(J);:GOSUB 50:PRINT "        ";:GOTO 206
204 PRINT USING "###.##         ";F(J);
206  NEXT J : PRINT
210 PRINT "PRICE ($)"
220  PRINT " PER";U$; SPC( 8)" EQUAL-RETURN ";C$;" YIELD/ACRE"
222 IF PR$ <> "Y" THEN 230
224 LPRINT : LPRINT "PRICE ($)"
226 LPRINT " PER";U$; SPC( 8)" EQUAL-RETURN ";C$;" YIELD/ACRE"
230 M = 0!
235 LOCATE  10,1
240  FOR I = 1 TO 5
250 D(I) = B1 + B1 * (M - 0.2)
260 M = M + 0.1
262 IF PR$ = "Y" THEN LPRINT USING "###.##       ";D(I);
263 IF I= 3 THEN GOSUB 51:PRINT USING "###.##";D(I);:GOSUB 50:PRINT "       ";:GOTO 270
264 PRINT USING "###.##       ";D(I);
270  FOR J = 1 TO 5
280 G(J) = (B * D(I) - E1 + E2) / F(J)
282 IF PR$ = "Y" THEN LPRINT USING "####.##        ";G(J);
283 IF J= 3 AND I = 3 THEN GOSUB 51:PRINT USING "####.##";G(J);:GOSUB 50:PRINT "        ";:GOTO 290
284 PRINT USING "####.##        ";G(J);
290  NEXT J
300  PRINT
302 IF PR$ = "Y" THEN LPRINT  : LPRINT
310  NEXT I
332 IF PR$ = "Y" THEN LPRINT  : LPRINT
334  PRINT
335  GOSUB 49007
337  GOSUB 38
340  PRINT
350 IF PR$ <> "Y" THEN 370
353 LPRINT  : LPRINT : LPRINT
354 LPRINT B$;: LPRINT SPC(16);C$;" YIELD PER ACRE"
356 LPRINT USING "PRICE = $###.##";B1
370  PRINT B$;:PRINT SPC(16);C$;" YIELD PER ACRE"
374  PRINT USING "PRICE = $###.##";B1
380 M = 0!
385 LOCATE 5,14
390  FOR J = 1 TO 5
400 L(J) = C + C * (M - 0.2)
402 IF PR$ = "Y" THEN LPRINT USING "###.##       ";L(J);
403 IF J= 3 THEN GOSUB 51:PRINT USING "###.## ";L(J);:GOSUB 50:PRINT "     ";:GOTO 410
404  PRINT USING "###.##       ";L(J);
410 M = M + 0.1
420  NEXT J : PRINT
430  IF PR$ <> "Y" THEN 440
432 LPRINT  : LPRINT " YIELD"
434 LPRINT "PER ACRE       EQUAL-RETURN ";C$;" $/"W$""
436 LPRINT
440 PRINT  : PRINT " YIELD"
450  PRINT "PER ACRE       EQUAL-RETURN ";C$;" $/"W$""
455 PRINT
460 M = 0!
465 LOCATE 10,1
470  FOR I = 1 TO 5
480 E(I) = B + B * (M - 0.2)
490 M = M + 0.1
492 IF PR$ = "Y" THEN LPRINT USING "####.##      ";E(I);
493 IF I= 3 THEN :GOSUB 51:PRINT USING "####.## ";E(I);:GOSUB 50:PRINT "     ";:GOTO 510
494 PRINT USING "####.##      ";E(I);
510  FOR J = 1 TO 5
520 G(J) = (E(I) * B1 - E1 + E2) / L(J)
522 IF PR$ = "Y" THEN LPRINT USING "###.##       ";G(J);
523 IF J= 3 AND I = 3 THEN PRINT " ";:GOSUB 51:PRINT USING "##.## ";G(J);:GOSUB 50:PRINT "      ";:GOTO 530
524  PRINT USING "###.##       ";G(J);
530  NEXT J : PRINT
532 IF PR$ = "Y" THEN LPRINT  : LPRINT
540  PRINT
542  NEXT I
543  PRINT
544 IF PR$ = "Y" THEN LPRINT  : LPRINT
546  PRINT
547  GOSUB 49007
548  GOSUB 38
585  PRINT
589 IF S9 = 4 THEN 42900
590  PRINT "0 = STOP, 1 = NEW BASE CROP, OR 2 = NEW COMPETING CROP ;"
600  INPUT S
610  IF S < 0 OR S > 2 THEN 585
615  GOSUB 38
617 IF S = 0 THEN 42900
620  IF S <  > 2 THEN  I1 = 18 : GOSUB 2072
640 GOTO 120
1000 REM
1500 GOSUB 38
1505  REM   DEFAULT DATA VALUES FOR THIS INPUT SECTION
1510 B$ = " CORN":QQ$(1) = "ENTER NAME OF BASE (OR DEFENDER) CROP..... "
1515 U$ = " BU. ":QQ$(2) = "ENTER UNIT OF YIELD FOR BASE CROP......... "
1520 B = 100:QQ$(3) = "ENTER EXPECTED BASE CROP YIELD / ACRE..... "
1525 B1 = 2.5:QQ$(4) = "ENTER EXPECTED BASE CROP PRICE ...($/UNIT) "
1529 QB$ =  "ENTER CASH FLOW EXPENSE / ACRE TO GROW "
1530 E1 = 150:QQ$(5) = "......(LESS SECONDARY CROP VALUE ?)......$ "
1535 C$ = " BEAN":QQ$(6) = "ENTER NAME OF COMPETING (ALTERNATE)CROP... "
1540 W$ = " BU. ":QQ$(7) = "ENTER UNIT OF YIELD FOR COMPETING CROP.... "
1545 C = 33:QQ$(8) = "ENTER EXPECTED YIELD FOR COMPETING CROP... "
1550 C1 = 0! : QQ$(9) = "ENTER EXPECTED PRICE FOR COMPETING CROP..$ "
1555 E2 = 80:QQ$(10) = "......(LESS SECONDARY CROP VALUE ?)......$ "
1556 RETURN : REM END DATA SETUP SUB ---ENTRY BELOW--------------------
1557  GOSUB 38 : IF S9 = 4 THEN 1570
1558 PRINT TAB(21); : GOSUB 51
1560   PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
1562  GOSUB 50 : PRINT
1570  GOSUB 39
1571 CV = CV - 1
1580  PRINT SPC(20);QQ$(1);B$
1585  PRINT
1590  PRINT SPC(20);QQ$(2);U$
1595  PRINT
1600  PRINT SPC(20);QQ$(3);B
1605  PRINT
1610  PRINT SPC(20);QQ$(4);B1
1615 PRINT SPC(20);QB$
1620  PRINT SPC(20);QQ$(5);E1
1622  REM   START DEFENDER SCREEN INPUT PRINT
1625  PRINT
1630  PRINT SPC(20);QQ$(6);C$
1635  PRINT
1640  PRINT SPC(20);QQ$(7);W$
1645 IF S9 = 5 THEN PRINT  ELSE GOSUB 1955
1650  PRINT SPC(20);QQ$(8);C
1655  PRINT
1660  PRINT SPC(20);QQ$(9);C1
1665 PRINT SPC(20);QB$
1667 PRINT SPC(20)QQ$(10);E2
1670  IF S8 =  - 1 THEN S8 = 0: RETURN
1671  IF S9 < 5 THEN LN = 20: GOTO 1891
1672  IF S = 2 THEN 1780
1675  GOSUB 41: GOSUB 49910 : GOSUB 40210
1680 GOSUB 41:GOSUB 40210 : LQ = 1:LN = 2: GOSUB 40
1685  GOSUB 40230: IF ZN$ <  > "" THEN B$ = ZN$
1690  GOSUB 41: GOSUB 40210
1695 LQ = 2:LN = 4: GOSUB 40
1700  GOSUB 40230: IF ZN$ <  > "" THEN U$ = ZN$
1705  GOSUB 41: GOSUB 40210
1710 LQ = 3:LN = 6: GOSUB 40
1715  GOSUB 40000: IF ZN$ <  > "" THEN B = ZN
1720 LO = 0:HI = 10000
1725  IF B < LO OR B > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1710
1730  GOSUB 41: GOSUB 40210
1735 LQ = 4:LN = 8: GOSUB 40
1740  GOSUB 40000: IF ZN$ <  > "" THEN B1 = ZN
1745 LO = 0:HI = 200
1750  IF B1 < LO OR B1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1735
1755  GOSUB 41: GOSUB 40210
1760 LQ = 5:LN = 10: GOSUB 40
1765  GOSUB 40000: IF ZN$ <  > "" THEN E1 = ZN
1770 LO = 0:HI = 3000
1775  IF E1 < LO OR E1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1760
1778  REM   START DEFENDER CROP INPUT
1780  GOSUB 41: GOSUB 40210
1785 LQ = 6:LN = 12: GOSUB 40
1790  GOSUB 40230: IF ZN$ <  > "" THEN C$ = ZN$
1795  GOSUB 41: GOSUB 40210
1800 LQ = 7:LN = 14: GOSUB 40
1805  GOSUB 40230: IF ZN$ <  > "" THEN W$ = ZN$
1810  GOSUB 41: GOSUB 40210
1812 LN = 14 : GOSUB 40 : GOSUB 1955
1815 LQ = 8:LN = 16: GOSUB 40
1820  GOSUB 40000: IF ZN$ <  > "" THEN C = ZN
1825 LO = 0:HI = 10000
1830  IF C < LO OR C > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1815
1835  GOSUB 41: GOSUB 40210
1840 LQ = 9:LN = 18: GOSUB 40
1845  GOSUB 40000: IF ZN$ <  > "" THEN C1 = ZN
1850 LO = 0:HI = 200
1855  IF C1 < LO OR C1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1840
1860  GOSUB 41: GOSUB 40210
1865 LQ = 10:LN = 20: GOSUB 40
1870  GOSUB 40000: IF ZN$ <  > "" THEN E2 = ZN
1875 LO = 0:HI = 3000
1880  IF E2 < LO OR E2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1865
1885  REM
1890  GOSUB 40210 : GOSUB 41:CX = 1:CY = CV + LN : GOSUB 42
1891  IF S9 = 4 THEN  PRINT : GOSUB 49000: RETURN
1892  GOSUB 41 : GOSUB 51
1893 LOCATE 23,1
1895  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N OR <CNTL-Q> = QUIT ENTIRE ANALYSIS ";
1902  GOSUB 50
1905  GOSUB 40610
1915  IF Z$ = QE$ THEN 38900
1920  IF Z$ = "N" THEN ON S GOTO 1680,1780
1925  IF Z$ < > "Y"  THEN BL$ : GOTO 1885
1930  GOSUB 38
1933 GOSUB 48700
1935  RETURN
1940  REM  ----------------------------------------
1950 REM special data entry note sub ------------------------
1955 GOSUB 51 :PRINT "A `0' entry for either centers the break even price or yield in the analysis." :GOSUB 50 : RETURN
1960 REM ------------------------------------------
2000  REM   ON-LINE INSTRUCTIONS PROCEDURE
2002  GOSUB 38 : I1 = 1
2005  LQ$(1) = "   "
2010  LQ$(2) = "    BEST CROP PROVIDES A SENSIVITY ANALYSIS OF VARIATION IN PRICES AND YIELDS"
2015  LQ$(3) ="FOR A BASE (OR DEFENDER) CROP AS COMPARED TO ONE OR MORE ALTERNATIVE (OR CHAL-"
2020  LQ$(4)= "LENGER) CROP WHICH COULD BE GROWN ON THE SAME LAND WITH AVAILABLE MACHINERY AND"
2025  LQ$(5) = "LABOR.   TO DO SO IT CALCULATES THE BREAKEVEN PRICE OR YIELD WHICH OFFERS THE "
2030  LQ$(6) = "SAME GROSS MARGIN I.E. THE SAME CONTRIBUTION TO OVERHEAD, RISKS AND PROFITS."
2032 LQ$(7) = "    "
2035  LQ$(8) = "    THE USER SHOULD THEN CONSIDER THE ODDS OF GETTING THESE PRICES AND YIELDS."
2040  LQ$(9) = "GROWING EXPENSES ARE ASSUMED TO BE CONSTANT REGARDLESS OF YIELD OR PRICE."
2042  LQ$(10) = "    "
2045  LQ$(11) = "    THE BASIC FORMULA USED IS: (BCP = BASE CROP PRICE ETC.)"
2050  LQ$(12) = "(BCP * BCY) -BCEXP = (CCP * CCY) -CCEXP"
2055  LQ$ (13) = "WHICH IS SOLVED FOR EITHER CCP OR CCY WHEN THE OTHER IS GIVEN AS IS VARIOUS "
2060  LQ$(14) = "LEVELS OF BCP AND BCY."
2061  PRINT : IF S9 = 4 THEN 2072
2063  LQ$(15) = "    "
2065  LQ$(16) = "    A TRIAL RUN WILL ILLUSTRATE THE APPROACH. A LISTING OF THE INPUT FORM WILL"
2070  LQ$(17) =  "PROVIDE FURTHER INPUT INSTRUCTIONS."
2072  LQ$(18) = "    "
2075  LQ$(19) = "THE USER SHOULD ALSO NOTE THAT EACH BASE CROP ANALYSIS ENDS WITH A NOTE:"
2080  LQ$(20) = "THIS ANALYSIS ASSUMES ENOUGH MACHINERY & TIME TO GROW EITHER CROP "
2085  LQ$(21) = "WITHOUT ADVERSE EFFECTS DUE TO MONO-CULTURE, ROTATION, PESTS, ETC."
2100 FOR I = I1 TO 21
2110 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 2140
2120 PRINT LQ$(I) : IF PR$ = "Y" THEN LPRINT LQ(I)
2140 NEXT I
2200 PRINT : GOSUB 49007 : GOSUB 38
2290  RETURN
2295  REM  ----------------------------------------
2400  REM      INPUT 8 SPECIAL MESSAGE PROCEDURE-SUB
2440  REM    END SUB
2500  REM   PROCEDURE TO REMIND USER OF BASIC ASSUMPTIONS
2507  REM
2530  IF PQ$ <  > "Y" THEN  GOSUB 39440
2535  RETURN
2540  REM  ---------------------------------
4568 O REM LOCATE 10,5
39400  REM   SUBS TO TOGGLE PRINTER
39410  IF PR$ <  > "Y" THEN  RETURN
39420  LOCATE 20,20 :PRINT "TURN PRINTER ON & PRESS ANY KEY ";: Z$ = INPUT$(1) : IF Z$ < > "" THEN RETURN
39425  GOTO 39420
39440 REM PRINT "THE PRINTER IS NOT BEING USED ?" : RETURN
39450  REM   ---------------------------------------
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39485 RETURN
39490  REM  ----------------------------------------
39560  REM   END PROCEDURE TO USE ? PRINTER
39570  REM
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN GOTO 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": GOSUB 46010
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 2002
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 2002
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46148  GOTO 46010
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   11/10/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   11/10/83              IBM - PC    !"
47350  PRINT SPC(20)"!      BEST CROP; A GROSS MARGIN      !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!   SENSITIVITY ANALYSIS TO VARIOUS   !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"!     POSSIBLE PRICES AND YIELDS      !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   11/10/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   11/10/83              IBM - PC    !"
48310  LPRINT "!      BEST CROP; A GROSS MARGIN      !"
48320  LPRINT "!                                     !"
48330  LPRINT "!   SENSITIVITY ANALYSIS TO VARIOUS   !"
48340  LPRINT "!                                     !"
48350  LPRINT "!     POSSIBLE PRICES AND YIELDS      !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50:GOSUB 49007:RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "BEST CROP TO GROW SELECTION BASED UPON COMPARATIVE GROSS MARGINS."
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149  REM   K2 = NO OF QUESTIONS
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);"  __________    ___________    ___________"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 9 GOTO 50200
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50120,50180,50140,50200
50108  GOTO 50300
50110  LQ$ = "Selected base or defender crop name (corn in the cornbelt?)."
50119  GOTO 50300
50120  LQ$ = "Bushel, ton, pound, cwt. bale, etc. (spell the unit of yield out)."
50129  GOTO 50300
50130  LQ$ = "The expected base crop yield in terms of units of yield / acre."
50139  GOTO 50300
50140  LQ$ = "The projected or planning (at harvest?) crop value as $ /unit of crop yield"
50149  GOTO 50300
50150  LQ$ = "the cash expense to grow an acre of the base crop - escaped if not grown."
50159  GOTO 50300
50160  LQ$ = "The name of the competing or challenger crop to be compared with the base crop"
50169  GOTO 50300
50180  LQ$ = "The estimated (expected) crop yield in terms of units of yield /acre."
50189  GOTO 50300
50200  LQ$ = "Exclude any overhead costs like land rent not affected by the crops grown."
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN

DATECALC.BAS

34000  REM  DEC 28/1983
34010  CLS : PRINT "PROJECTED CALENDAR DATES & CALENDARS"
34020  PRINT : PRINT " 0 = RETURN TO THE DISK MAIN MENU"
34030  PRINT " 1 = PROJECT A DATE GIVEN NO. OF DAYS"
34040  PRINT " 2 = PRINT OR LIST A MONTHLY CALENDAR"
34050  PRINT " WHICH OPTION ";: INPUT K2
34060  IF K2 = 0 THEN  CHAIN "MENU"
34070  IF K2 = 1 THEN 37000 : IF K2 = 2 THEN 35000
34071  IF K2 > 2 THEN COLOR 0,7
34072  PRINT : PRINT
34075  IF K2>2 THEN PRINT "OPTION NUMBER SHOULD BE A (0,1, OR 2)":COLOR 7,0:PRINT:PRINT:IF K2>2 THEN 34020
35000  REM
35010  CLS
35030  CLEAR : PRINT
35040  DIM A(12),R$(12)
35050 K = 0
35060  FOR I = 1 TO 12: READ A(I): NEXT I
35070  FOR I = 1 TO 12: READ R$(I): NEXT I
35080  LOCATE 4,1
35090  INPUT "HOW MANY MONTHS WOULD YOU LIKE LISTED";N
35100  IF N = 1 THEN  PRINT "TYPE THE MONTH NUMBER"
35105  IF N > 1 THEN  PRINT "TYPE THE NUMBER OF THE MONTH TO START WITH."
35110 GOTO 35112
35112 INPUT "(1 = JANUARY.....6 = JUNE .....12 = DECEMBER ETC.)";M
35115 IF M>12 THEN 35117: IF M<1 THEN 35117
35116 GOTO 35119
35117 COLOR 0,7:PRINT:PRINT"THE NUMBER OF THE MONTH MUST BE (1 TO 12) PLEASE RE-ENTER":COLOR 7,0
35119 PRINT:IF M>12 THEN 35105: IF M<1 THEN 35105
35120 PRINT "ENTER YEAR...(IF YEAR IS IN THE 1900'S, THEN ENTERRING THE LAST TWO DIGITS WILL SUFFICE.)";
35121 INPUT Y: IF Y < 100 THEN Y = 1900 + Y
35130 PRINT:PRINT"WOULD YOU LIKE OUTPUT ON THE SCREEN OR THE PRINTER (S/P)";:INPUT S$ : K2$ = S$ : GOSUB 60400 : S$ = K2$
35132 IF S$ ="P" THEN SW = 1:LPRINT: GOTO 35170
35140  IF S$ <  > "S" THEN 35130
35150 SW = 0
35160  CLS : LOCATE 4,1
35170 MZ = M - 2:YZ = Y
35180  IF SW = 1 THEN 35210
35190 K = K + 1: IF K > 13 THEN K = 2
35200  IF K = 3 OR K = 5 OR K = 7 OR K = 9 OR K = 11 OR K = 13 THEN  PRINT :LOCATE 21,30: PRINT "HIT ANY KEY TO CONTINUE":X$=INPUT$(1):CLS:LOCATE 4,30
35210  IF M = 1 THEN MZ = 11:YZ = Y - 1
35220  IF M = 2 THEN MZ = 12:YZ = Y - 1
35230  REM ...FIND STARTING DAY-OF-WEEK
35240 CZ =  INT (YZ / 100 + 0.005):YZ = YZ - 100 * CZ:DM = 1
35250 D1 =  INT (2.6 * MZ) + DM + YZ
35257 IF MZ=10 THEN D1 = D1 -1
35258 IF MZ=5 THEN D1 = D1 -1
35260 D1 = D1 +  INT (YZ / 4 + 0.1) +  INT (CZ / 4 + 0.1) - 2 * CZ
35270 DW = D1 - 7 *  INT (D1 / 7 + 0.01) + 1
35280  IF SW = 0 THEN LOCATE  ,30 : GOTO 35420
35290 M = M + 1: IF M > 12.5 THEN M = 1:Y = Y + 1
35300 N = N - 1
35310 MZ = M - 2:YZ = Y
35320  IF M = 1 THEN MZ = 11:YZ = Y - 1
35330  IF M = 2 THEN MZ = 12:YZ = Y - 1
35340 K = K + 1:CZ =  INT (YZ / 100 + 0.005):YZ = YZ - 100 * CZ:DM = 1
35350 D2 =  INT (2.6 * MZ) + DM + YZ
35357  IF MZ=10 THEN D2 = D2 -1
35358  IF MZ=5 THEN D2 = D2 -1
35360 D2 = D2 +  INT (YZ / 4 + 0.1) +  INT (CZ / 4 + 0.1) - 2 * CZ
35370 DX = D2 - 7 *  INT (D2 / 7 + 0.01) + 1
35380  REM ...PRINT HEADER
35390 M2 = M: IF M2 = 1 THEN M2 = 13
35400 Y2 = Y: IF M2 > M THEN Y2 = Y - 1
35403  LPRINT R$(M2 - 1);: LPRINT " ";: LPRINT Y2;: LPRINT " ";: LPRINT "***",: LOCATE ,30
35405  LPRINT R$(M);: LPRINT " ";Y;" ***"
35407  LPRINT " S  M  T  W  T  F  S ",
35408  LOCATE ,30: LPRINT " S  M  T  W  T  F  S "
35409  GOTO 35450
35410  PRINT R$(M2 - 1);: PRINT " ";: PRINT Y2;: PRINT " ";: PRINT "***";: LOCATE ,24
35420  PRINT R$(M);: PRINT " ";Y;" ***"
35425 IF S$="S" THEN LOCATE ,30
35430  PRINT " S  M  T  W  T  F  S ";: IF SW = 0 THEN  PRINT : GOTO 35460
35440  LOCATE ,24: REM PRINT " S  M  T  W  T  F  S "
35450  REM ...BUILD FIRST DATE-LINE & PRINT
35460 L$ = "":D1 = DW - 0.5: IF SW = 0 THEN 35480
35470 L2$ = "":D2 = DX - 0.5
35480  FOR I = 1 TO 7
35490 DT = I - DW + 1
35500  IF I < D1 THEN L$ = L$ + "  "
35510  IF I > D1 THEN L$ = L$ + " " +  CHR$ (48 + DT)
35520  IF I < 6.5 THEN L$ = L$ + " "
35530  NEXT I
35540  IF SW = 0 THEN 35605
35550  FOR I = 1 TO 7
35560 DU = I - DX + 1
35570  IF I < D2 THEN L2$ = L2$ + "  "
35580  IF I > D2 THEN L2$ = L2$ + " " +  CHR$ (48 + DU)
35590  IF I < 6.5 THEN L2$ = L2$ + " "
35600  NEXT I
35601  LPRINT L$,
35602  LOCATE ,30: LPRINT L2$
35603  GOTO 35630
35605  IF S$="S" THEN LOCATE ,30
35610  PRINT L$;: IF SW = 0 THEN  PRINT : GOTO 35630
35620  LOCATE ,24: PRINT L2$
35630  REM ...CHECK FOR LEAP-YEAR
35640 C =  INT (Y / 100 + 0.005):YC = Y - 100 * C
35650 A(2) = 28
35660  IF YC = 4 *  INT (YC / 4 + 0.1) THEN A(2) = 29
35670  IF YC < 0.5 THEN A(2) = 28
35680  IF YC < 0.5 AND C = 4 *  INT (C / 4 + 0.1) THEN A(2) = 29
35690  REM ...BUILD REMAINING DATE-LINES AND PRINT
35700 EN = 0
35710 EO = 0
35720 L$ = "":L2$ = ""
35730  FOR I = 1 TO 7
35740 DT = DT + 1: IF SW = 0 THEN 35770
35745 A(0) = 31
35750  IF DT > A(M - 1) + 0.5 THEN EN = 1: GOTO 35862
35760  IF SW = 1 THEN 35780
35770  IF DT > A(M) + 0.5 THEN EN = 1: GOTO 35945
35780 D1 =  INT (DT / 10 + 0.05):D2 = DT - 10 * D1
35790  IF D1 < 0.5 THEN L$ = L$ + " "
35800  IF D1 > 0.5 THEN L$ = L$ +  CHR$ (48 + D1)
35810 L$ = L$ +  CHR$ (48 + D2)
35820  IF I < 6.5 THEN L$ = L$ + " "
35830  NEXT I
35840  IF SW = 0 THEN 35945
35850 L2$ = ""
35860  IF EN > 0.5 THEN L$ = ""
35862 IF LEN(L$) = 20 THEN 35870
35864 FOR I = LEN(L$) TO 19
35866 L$ = L$ + " "
35868 NEXT I
35870  FOR I = 1 TO 7
35880 DU = DU + 1: IF DU > A(M) + 0.5 THEN EO = 1: GOTO 35945]
35890 D2 =  INT (DU / 10 + 0.05):D4 = DU - 10 * D2
35900  IF D2 < 0.5 THEN L2$ = L2$ + " "
35910  IF D2 > 0.5 THEN L2$ = L2$ +  CHR$ (48 + D2)
35920 L2$ = L2$ +  CHR$ (48 + D4)
35930  IF I < 6.5 THEN L2$ = L2$ + " "
35940  NEXT I
35941  LPRINT L$;SPC(8);L2$
35942  REM LPRINT L2$
35943  GOTO 35970
35945 IF S$="S" THEN LOCATE ,30
35947 IF SW = 1 THEN 35941
35950  PRINT L$;: IF SW = 0 THEN  PRINT : GOTO 35970
35960  LOCATE ,24: PRINT L2$
35970  IF EN < 0.5 THEN 35720
35980  IF SW = 0 THEN 36000
35990  IF EO < 0.5 THEN 35850
36000  PRINT " "
36010  REM ...DO IT AGAIN FOR NEXT MONTH
36020 M = M + 1: IF M > 12.5 THEN M = 1:Y = Y + 1
36030 N = N - 1: IF N > 0.5 THEN 35170
36032 IF S$<>"S" THEN 36040
36033 PRINT: LOCATE ,30
36035 PRINT "HIT ANY KEY TO CONTINUE";:X$=INPUT$(1)
36040  LOCATE 22,1: GOTO 34010
36050  DATA  31,28,31,30,31,30,31,31,30,31,30,31
36060  DATA    "*** JANUARY","** FEBRUARY","***** MARCH","***** APRIL"
36070  DATA  "******  MAY","****** JUNE"            ,****** JULY
36080  DATA   "**** AUGUST","* SEPTEMBER","*** OCTOBER","** NOVEMBER","** DECEMBER"
36100  GOTO 34010
37000  REM  START  DATE CALCULATOR PROCEDURE
37100  CLS
37110  GOSUB 38450
37120  REM
37130  CLEAR
37135  DIM W$(7),M$(12)
37140 M$(1) = "JANUARY"
37150 M$(2) = "FEBUARY"
37160 M$(3) = "MARCH"
37170 M$(4) = "APRIL"
37180 M$(5) = "MAY"
37190 M$(6) = "JUNE"
37200 M$(7) = "JULY"
37210 M$(8) = "AUGUST"
37220 M$(9) = "SEPEMBER"
37230 M$(10) = "OCTOBER"
37240 M$(11) = "NOVEMBER"
37250 M$(12) = "DECEMBER"
37260  GOTO 37420
37270  REM   ---------------------------------
37280  REM    PROCEDURE TO CALCULATE DATE FROM NO OF DAYS.
37290  IF FLAG < 0 THEN 37330
37300  GOSUB 38300
37310  IF Y < 100 THEN Y = 1900 + Y
37320  GOTO 37350
37330 M = FM:D = FD:Y = FY
37340  REM
37350 A = Y - (M < 3)
37360 MD = Y -  INT (Y / 58)
37370 N = MD * 365 - Y / 58 * 82 + A / 4 - A / 400 + M * 31 - M / 12 - M / 7 - M / 5 - 3 * (M > 2) + D
37380  IF N < 0 THEN N = N + 21252
37390  RETURN
37400  REM   END PROCEDURE SUB --------------
37410  REM
37420  REM
37430 W$(1) = "SUNDAY"
37440 W$(2) = "MONDAY"
37450 W$(3) = "TUESDAY"
37460 W$(4) = "WEDNESDAY"
37470 W$(5) = "THURSDAY"
37480 W$(6) = "FRIDAY"
37490 W$(7) = "SATURDAY"
37500  REM
37510  PRINT : PRINT "CALENDAR"
37520 FLAG = 1
37530  PRINT N$: PRINT "TYPE START DATE AS 'MM/DD/YY'";
37540  GOSUB 37290: PRINT
37550  REM
37560 BN = N:BD = D:BM = M:BY = Y
37570  REM    ..??WHY SWAP VALUES???
37580 N = BN:D = BD:M = BM:Y = BY: PRINT "STARTING DATE ";M;"/";D;"/";Y;: PRINT :N1 = N
37590  PRINT : PRINT "DAY OF THE WEEK; SUNDAY = 1..MONDAY = 2...SATURDAY = 7...WHICH";: INPUT WD
37600  IF WD < 1 OR WD > 7 THEN 37590
37610 WD = WD - 1: IF WD < 1 THEN WD = 7
37620  PRINT : PRINT "NO. OF DAYS TO TARGET TIME ";
37630  INPUT DP
37640 INC = 1: REM  INC IMPLIES DAILY RESULTS
37650 WK =  INT (DP / 7)
37660 WT = DP - (WK * 7) + WD
37670  IF WT > 7 THEN WT = WT - 7
37680 MOS =  INT (DP / 30)
37690 SP = (WK - 1) * 7
37700 N = DP:DP = DP + 7
37710  REM
37715 CLS
37720  PRINT "CALENDAR DATES PROJECTED ";SP;" TO ";DP;" DAYS"
37730  PRINT
37740  PRINT : PRINT "STARTING ON A ";W$(WD)
37750  FOR Z = 1 TO DP STEP INC
37760  FOR Z = 1 TO DP STEP INC
37770  IF D < CD + 1 THEN 37850
37780 D = D - CD:M = M + 1: IF M < 13 THEN 37800
37790 M = 1
37800  GOSUB 38060
37810  IF M = 1 THEN Y = Y + 1:MFLAG = 1
37820  IF (MOS * 30) > Z THEN 37850
37830  PRINT : PRINT M$(M);" OF ";Y
37840  PRINT
37850  IF Z < SP THEN 37900
37860  PRINT " ";D;: IF D < 10 THEN  PRINT " ";
37870  IF N <  > Z THEN 37900
37880 COLOR 0,7: PRINT : PRINT : PRINT W$(WT);", ";M$(M);" ";D;" ";Y;" IS THE TARGET DATE; THE ";N;" TH DAY.":COLOR 7,0
37890  PRINT
37900 D = D + INC: NEXT Z : NEXT Z: PRINT
37910  PRINT:LOCATE 23,1
37920  PRINT "TRY AGAIN ? (Y OR N OR HELP) ";: INPUT B$ : B$ = LEFT$(B$,1) :K2$ = B$ : GOSUB 60400 : B$ = K2$
37930  IF  LEN (B$) = 0 THEN 37920
37940  IF  LEFT$ (B$,1) = "H" THEN  GOSUB 38450
37950  IF  LEFT$ (B$,1) = "N" THEN 37980
37960  REM
37970  GOTO 37510
37980  GOTO 34010
37990  REM   ADVANCE TO NEXT MONTH
38000 FY = Y:FM = M:FD = 1
38010 M = M + 1: IF M < 13 THEN 38040
38020 M = 1:Y = Y + 1
38030  REM
38040 FLAG = 1: GOTO 37580
38050  REM    PROCEDURE TO ADJUST FOR DAYS IN MONTH * *
38060 CD = 31
38070  IF M = 2 GOTO 38100
38080  IF (M = 4) OR (M = 6) OR (M = 9) OR (M = 11) THEN CD = 30
38090  GOTO 38130
38100 CD = 28
38110  IF (M / 100) = ( INT (M / 100)) THEN 38130
38120  IF (M / 4) = ( INT (M / 4)) THEN CD = 29
38130  RETURN
38140  GOTO 37420
38150  REM  ---------------------------------
38160  REM    CALC STRING VALUES PROCEDURE SUB
38170 NUM = 0:SIGN = 0: IF  LEN (IN$) = 0 THEN  RETURN
38180 SIGN = 1:L$ = "":C$ = ""
38190 L$ = L$ + C$
38200 C$ =  LEFT$ (IN$,1)
38210  IF  ASC (C$) < 48 OR  ASC (C$) > 57 THEN 38260
38220 C$ = L$ + C$
38230 NUM =  VAL (C$)
38240 IN$ =  MID$ (IN$,2,( LEN (IN$) - 1))
38250  GOTO 38190
38260 IN$ =  MID$ (IN$,2,( LEN (IN$) - 1))
38270  RETURN
38280  REM  ---------------------------------
38290  REM     DATE INPUT PROCEDURE SUB
38300 REM
38310  GOTO 38330
38320  PRINT " DATA NOT UNDERSTOOD MO =?";M;" DAY =? ";D;" YEAR =? ";Y;" ...RE-ENTER.."
38330  REM
38333 M=0:D=0
38334 INPUT IN$
38335 IF LEN(IN$)=0 THEN 38320
38340 IN$ =  LEFT$ (IN$,10) + "QUIT"
38350  GOSUB 38160: IF SIGN < 1 THEN 38320
38360 M = NUM
38370  IF M < 1 OR M > 12 THEN 38320
38380  GOSUB 38160: IF SIGN < 1 THEN 38320
38390 D = NUM
38400  IF D < 1 THEN 38320
38410  GOSUB 38160: IF SIGN < 1 THEN 38320
38415  IF NUM > 3000 THEN NUM = NUM - ( INT (NUM / 10000) * 10000)
38420 Y = NUM
38430  IF (Y > 0 AND Y < 100) OR (Y > 1899 AND Y < 2999) THEN 38440: GOTO 38320
38440  GOSUB 38060: IF D > CD THEN 38320: RETURN
38450  REM   PROCEDURE TO PRINT EXPECTED         GESTATION PERIODS
38455 CLS
38460  PRINT
38470  PRINT "EXPECTED GESTATION INTERVAL BY SPECIES"
38480  PRINT "BREEDING TO BIRTH    ESTRUS CYCLE"
38490  PRINT "--------------------------------------"
38500  PRINT
38510  PRINT "CATTLE....283 DAYS"
38520  REM
38530  PRINT "HORSES....340 DAYS"
38540  REM
38550  PRINT "SHEEP.....148 DAYS"
38560  REM
38570  PRINT "SWINE.....114 DAYS"
38580  REM
38590  RETURN
38600  REM   TABLE PROCEDURAL SUB ENDS
38610  REM  END DATE PROJECTION PROCEDURE
42903 K2$ = Z$ : GOSUB 60400 : Z$ = K2$
60400 I% = ASC(K2$)
60410 IF I% > 96 AND I% < 123 THEN K2$ = CHR$(I%-32)
60420 RETURN
60500 LOCATE 13,1
60510 GOSUB 51: PRINT"   FOR A HARDCOPY OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc *'.  FOR A HARDCOPY OF EVERYTHING WHICH APPEARS ON THE SCREEN PRESS 'Ctrl' AND 'PrtSc *'.":GOSUB 50:GOSUB 49000:RETURN

DRYSTORE.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF COMBINED GRAIN DRYSTORE STORECOSTS 03/16/84. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70 DIM QQ$(20),LQ$(10),A(4),E(12,4),F(12,4)
80  GOSUB 1000
90  GOSUB 47300
100  GOSUB 46000
200 GOSUB 1240
210 GOSUB 38
300 S1 = S2*0.01 : D1 = D2 * 0.01 : R1 = 2 * 0.01
480  IF O4 > C4 GOTO 495
490 C3 = O4
492  GOTO 500
495 C3 = C4
500 A2 = (O4 - C3) * O7
510  IF A2 > 0 GOTO 530
520 A2 = 0
530 A1 = O6 + A2 + O8 * (C3 - O5)
535 B2 = (O4 - O5) * I2 * 0.01
540 B1 = B2 * O1
550 C1 = O1 * O2 / 1200 * O3
560 C6 = O3 - 3
570  IF C6 > 0 GOTO 590
580 C6 = 0
590 D1 = I0 + I1 * C6
600  REM   E1=A1+B1+C1+D1
605  REM   E2=E1+O1
610 E = O1 * (O4 - O5) * O9 * 0.01
620  REM   A=A1+B1-E/(1-(B1/O1))
622 G1 = A1 + B1
623 G = O1 - G1
625 F = O1 - E
630  REM   B=I3-E1
632 A3 = (O5 - I8) * O8
636 B4 = (O5 - I8) * I2 * 0.01 + D1 + S1*O3
638 B3 = B4 * O1
642 H2 = A3 + B3 + C1
644 H1 = G1 + H2
645 B = I3 - H1
646 C = I4 - H1
647 E1 = G + D1
648 E2 = G + H1 + D1
649  PRINT
650 D = I5 - I6 - I7 - H1
655 GOSUB 38
660  IF E <  = 0! THEN 680
665  PRINT "MOISTURE DISCOUNT IF SOLD WET.....................$/BU", INT (E * 1000) / 1000
670  PRINT "NET PRICE FROM SELLING WET AT HARVEST.............$/BU", INT (F * 1000) / 1000
675  PRINT
680  IF A1 <  = 0! THEN 705
685  PRINT "DRYING COST TO DRY TO MARKET REQUIREMENTS ........$/BU", INT (A1 * 1000) / 1000
690  PRINT "SHRINKAGE COST DUE TO DRYING FOR HARVEST SALE ....$/BU", INT (B1 * 1000) / 1000
695 A$ = "(HARVEST TO MARKET MOISTURE SHRINKAGE = "
700  PRINT A$;B4 * 100;" PERCENT)"
705  PRINT USING "NET PRICE SOLD @ HARVEST @ ##.#% MOISTURE ........$/BU ###.###";O5;G
710  PRINT
715  IF A3 <  = 0! THEN 740
720  PRINT "ADDED DRYING COST DUE TO STORAGE & DRY SALE ......$/BU", INT (A3 * 1000) / 1000
725  PRINT "SHRINKAGE COST DUE TO STORAGE & HANDLING .........$/BU", INT (B3 * 1000) / 1000
730 A$ = "(POST HARVEST STORAGE SHRINKAGE = "
735  PRINT A$;B4 * 100;" PERCENT)"
740  PRINT "OPPORTUNITY INTEREST COST IF STORED...............$/BU", INT (C1 * 1000) / 1000
745  PRINT USING "TOTAL DRYING + SHRINK + INTEREST TO STORE ## MOS..$/BU ###.###";O3;H2
750  PRINT
755  PRINT "NET PRICE FROM STORING & LATER PRICING CASH.......$/BU", INT (B * 1000) / 1000
760  PRINT "NET PRICE FROM STORING & CONTRACTING..............$/BU", INT (C * 1000) / 1000
765  PRINT "NET PRICE FROM STORING & HEDGING ON FUTURES.......$/BU", INT (D * 1000) / 1000
770  PRINT
775  PRINT "STORAGE COST IF STORED COMERCIALLY................$/BU", INT (D1 * 1000) / 1000
780  PRINT "HARVEST PRICE + TOTAL COM'L STORAGE COSTS.........$/BU", INT (E1 * 1000) / 1000
785  PRINT
790 GOSUB 49007
792 PRINT
794 GOSUB 4010
796 IF PR$ = "Y" THEN GOSUB 860
800  GOTO 100
860 REM ----------BEGIN PRINTED RESULTS SUB ------------------
865 LPRINT "MOISTURE DISCOUNT IF SOLD WET.....................$/BU", INT (E * 1000) / 1000
870 LPRINT "NET PRICE FROM SELLING WET AT HARVEST.............$/BU", INT (F * 1000) / 1000
875 LPRINT
880  IF A1 <  = 0! THEN 905
885 LPRINT "DRYING COST TO DRY TO MARKET REQUIREMENTS ........$/BU", INT (A1 * 1000) / 1000
890 LPRINT "SHRINKAGE COST DUE TO DRYING FOR HARVEST SALE ....$/BU", INT (B1 * 1000) / 1000
895 A$ = "(HARVEST TO MARKET MOISTURE SHRINKAGE = "
900 LPRINT A$;B4 * 100;" PERCENT)"
905 LPRINT USING "NET PRICE SOLD @ HARVEST @ ##.#% MOISTURE ........$/BU ###.###";O5;G
910 LPRINT
915  IF A3 <  = 0! THEN 940
920 LPRINT "ADDED DRYING COST DUE TO STORAGE & DRY SALE ......$/BU", INT (A3 * 1000) / 1000
925 LPRINT "SHRINKAGE COST DUE TO STORAGE & HANDLING .........$/BU", INT (B3 * 1000) / 1000
930 A$ = "(POST HARVEST STORAGE SHRINKAGE = "
935 LPRINT A$;B4 * 100;" " PERCENT)"
940 LPRINT "OPPORTUNITY INTEREST COST IF STORED...............$/BU", INT (C1 * 1000) / 1000
945 LPRINT USING "TOTAL DRYING + SHRINK + INTEREST TO STORE ## MOS..$/BU ###.###";O3;H2
950 LPRINT
955 LPRINT "NET PRICE FROM STORING & LATER PRICING CASH.......$/BU", INT (B * 1000) / 1000
960 LPRINT "NET PRICE FROM STORING & CONTRACTING..............$/BU", INT (C * 1000) / 1000
965 LPRINT "NET PRICE FROM STORING & HEDGING ON FUTURES.......$/BU", INT (D * 1000) / 1000
970 LPRINT
975 LPRINT "STORAGE COST IF STORED COMERCIALLY................$/BU", INT (D1 * 1000) / 1000
980 LPRINT "HARVEST PRICE + TOTAL COM'L STORAGE COSTS.........$/BU", INT (E1 * 1000) / 1000
985 LPRINT
990 RETURN
995 REM ------------- END PRINTED RESULTS SUB -----------------
1000  REM
1010  REM  TO AVOID RE-DIMENSIONING ERRORS, DIM DECLARATIONS SHOULD BE MOVED TO THE 'TOP' OF THE PROGRAM
1020 K2 = 18:CH = 64
1030  REM  DEFAULT DATA VALUES FOR THIS INPUT SECTION
1040 O1 =2.6 :QQ$(1) = "NET AT FARM FOB PRICE FOR HARVEST DELIVERY $ / BU... "
1050 I2 = 0.5  :QQ$(2) = "PERCENT SHRINK IN BUSHELS PER POINT MOISTURE REMOVED "
1060 O4 = 23  :QQ$(3) = "AVERAGE GRAIN MOISTURE CONTENT AT HARVEST TIME... %. "
1070 O5 = 15.5:QQ$(4) = "MOISTURE CONTENT ALLOWED BY TERMS OF SALE ........%. "
1080 O9 = 2   :QQ$(5) = "DISCOUNT / POINT MOISTURE OVER XX.X% CONTENT (CENTS) "
1090 O6 = 0.06: QQ$(6) = "BASE DRYING CHARGE COMMERICALLY ................$/BU "
1100 O7 = 0.015:QQ$(7) = "DRYING CHARGE RATE / POINT OVER 25% .........$/BU/PT "
1110 O8 = 0.01: QQ$(8) = "DRYING CHARGE RATE / POINT FOR UNDER 25% ..$/BU./PT. "
1120 O3 = 8.08:QQ$(9) = "IF STORED, THE NO. OF MONTHS GRAIN WILL BE STORED .. "
1130 IO = 0.015:QQ$(10)= "COMMERCIAL BASE STORAGE CHARGE FOR 1ST 3 MO'S..$/BU. "
1140 I1 = 0.015:QQ$(11)= "COMMERCIAL STORAGE CHARGE AFTER 3 MOS / BU / MONTH $ "
1150 I8 = 13.5:QQ$(12)= "MAXIMUM MOISTURE CONTENT FOR SAFE STORAGE .........% "
1160 O2 = 15 :QQ$(13) = "ALTERNATIVE USE OF FUNDS OPPORTUNITY INTEREST RATE % "
1170 I3 = 2.43:QQ$(14)= "ESTIMATED CASH MARKET PRICE IF CROP IS STORED  $/BU. "
1180 I4 = 2.4:QQ$(15) = "CURRENT CONTRACT PRICE QUOTATION ..............$/BU. "
1185 I5 = 2.65:QQ$(16)= "CURRENT COMPARABLE FUTURES PRICE QUOTE ........$/BU. "
1190 I6 = 0.3: QQ$(17) = "ESTIMATED BASIS WHEN HEDGE IS TO BE LIFTED ....$/BU. "
1195 I7 = 0.02:QQ$(18) = "PRORATED FUTURES TRANSACTION CHARGES ..........$/BU. "
1200 D2 = 1.5:QQ$(19) = "PERCENT GRAIN DAMAGE (LOSS) IN & OUT OF STORAGE .(%) "
1210 S2 = 0.001:QQ$(20) = "PERCENT STORAGE LOSS / MONTH KEPT IN STORAGE ....(%) "
1215  RETURN
1220 REM ----END INPUT SETUP & BEGIN DATA ENTRY SUBS ----------------------
1230  REM  GOSUB 49100 TO PRINT A INPUT FORM ON PAPER.  (K2 = NO. OF QUESTIONS)
1240 GOSUB 38
1250  LOCATE,21:GOSUB 51:PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
1260  GOSUB 50
1270  GOSUB 39
1280  PRINT SPC(10);QQ$(1);O1
1290  PRINT SPC(10);QQ$(2);I2
1300  PRINT SPC(10);QQ$(3);O4
1310  PRINT SPC(10);QQ$(4);O5
1320  PRINT SPC(10);QQ$(5);O9;
1325 IF S9 <> 4 THEN PRINT ELSE LOCATE ,42 : PRINT USING "##.#% CONTENT (CENTS) ";O5
1330  PRINT SPC(10);QQ$(6);O6
1340  PRINT SPC(10);QQ$(7);O7
1350  PRINT SPC(10);QQ$(8);O8
1360  PRINT SPC(10);QQ$(9);O3
1370  PRINT SPC(10);QQ$(10);IO
1380  PRINT SPC(10);QQ$(11);I1
1390  PRINT SPC(10);QQ$(12);I8
1400  PRINT SPC(10);QQ$(13);O2
1410  PRINT SPC(10);QQ$(14);I3
1420  PRINT SPC(10);QQ$(15);I4
1430  PRINT SPC(10);QQ$(16);I5
1440  PRINT SPC(10);QQ$(17);I6
1450  PRINT SPC(10);QQ$(18);I7
1452  PRINT SPC(10);QQ$(19);D2
1454  PRINT SPC(10);QQ$(20);S2
1455  IF S9 = 4 THEN  GOSUB 49000 : RETURN
1460  GOSUB 41: GOSUB 49910
1468  GOSUB 40210
1470 LQ = 1:LN = 1: GOSUB 40
1480  GOSUB 40000: IF ZN$ <  > "" THEN O1 = ZN
1490 LO = 1:HI = 10
1500  IF O1 < LO OR O1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1470
1510  GOSUB 40210
1520 LQ = 2:LN = 2: GOSUB 40
1530  GOSUB 40000: IF ZN$ <  > "" THEN I2 = ZN
1540 LO = 0.05:HI = 0.5
1550  IF I2 < LO OR I2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1520
1560  GOSUB 40210
1570 LQ = 3:LN = 3: GOSUB 40
1580  GOSUB 40000: IF ZN$ <  > "" THEN O4 = ZN
1590 LO = 8:HI = 32
1600  IF O4 < LO OR O4 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1570
1610  GOSUB 40210
1620 LQ = 4:LN = 4: GOSUB 40
1630  GOSUB 40000: IF ZN$ <  > "" THEN O5 = ZN
1640 LO = 8:HI = 16
1650  IF O5 < LO OR O5 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1620
1660  GOSUB 40210
1670 LQ = 5:LN = 5: GOSUB 40
1675 LOCATE ,42 : PRINT USING "##.#% CONTENT (CENTS) ";O5;
1680  GOSUB 40000: IF ZN$ <  > "" THEN O9 = ZN
1690 LO = 0.5:HI = 3
1700  IF O9 < LO OR O9 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1670
1710  GOSUB 40210
1720 LQ = 6:LN = 6: GOSUB 40
1730  GOSUB 40000: IF ZN$ <  > "" THEN O6 = ZN
1740 LO = 0.02:HI = 0.09999999
1750  IF O6 < LO OR O6 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1720
1760  GOSUB 40210
1770 LQ = 7:LN = 7: GOSUB 40
1780  GOSUB 40000: IF ZN$ <  > "" THEN O7 = ZN
1790 LO = 0.005000001:HI = 0.05
1800  IF O7 < LO OR O7 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1770
1810  GOSUB 40210
1820 LQ = 8:LN = 8: GOSUB 40
1830  GOSUB 40000: IF ZN$ <  > "" THEN O8 = ZN
1840 LO = 0.005000001:HI = 0.05
1850  IF O8 < LO OR O8 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1820
1860  GOSUB 40210
1870 LQ = 9:LN = 9: GOSUB 40
1880  GOSUB 40000: IF ZN$ <  > "" THEN O3 = ZN
1890 LO = 4:HI = 36
1900  IF O3 < LO OR O3 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1870
1910  GOSUB 40210
1920 LQ = 10:LN = 10: GOSUB 40
1930  GOSUB 40000: IF ZN$ <  > "" THEN IO = ZN
1940 LO = 0.005000001:HI = 0.5
1950  IF IO < LO OR IO > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1920
1960  GOSUB 40210
1970 LQ = 11:LN = 11: GOSUB 40
1980  GOSUB 40000: IF ZN$ <  > "" THEN I1 = ZN
1990 LO = 0.005000001:HI = 0.05
2000  IF I1 < LO OR I1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1970
2010  GOSUB 40210
2020 LQ = 12:LN = 12: GOSUB 40
2030  GOSUB 40000: IF ZN$ <  > "" THEN I8 = ZN
2040 LO = 8:HI = 16
2050  IF I8 < LO OR I8 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2020
2060  GOSUB 40210
2070 LQ = 13:LN = 13: GOSUB 40
2080  GOSUB 40000: IF ZN$ <  > "" THEN O2 = ZN
2090 LO = 5:HI = 18
2100  IF O2 < LO OR O2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2070
2110  GOSUB 40210
2120 LQ = 14:LN = 14: GOSUB 40
2130  GOSUB 40000: IF ZN$ <  > "" THEN I3 = ZN
2140 LO = 1!:HI = 10
2150  IF I3 < LO OR I3 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2120
2160  GOSUB 40210
2170 LQ = 15:LN = 15: GOSUB 40
2180  GOSUB 40000: IF ZN$ <  > "" THEN I4 = ZN
2190 LO = 1!:HI = 10
2200  IF I4 < LO OR I4 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2170
2210  GOSUB 40210
2220 LQ = 16:LN = 16: GOSUB 40
2230  GOSUB 40000: IF ZN$ <  > "" THEN I5 = ZN
2240 LO = 1!:HI = 10
2250  IF I5 < LO OR I5 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2220
2260  GOSUB 40210
2270 LQ = 17:LN = 17: GOSUB 40
2275  GOSUB 40000: IF ZN$ <  > "" THEN I6 = ZN
2280 LO = 0!:HI = 0.75
2285  IF 16 < LO OR I6 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2270
2290  GOSUB 40210
2295 LQ = 18:LN = 18: GOSUB 40
2300  GOSUB 40000: IF ZN$ <  > "" THEN I7 = ZN
2305 LO = 0.01:HI = 0.05
2310  IF I7 < LO OR I7 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2295
2315 LQ = 19:LN = 19: GOSUB 40
2320  GOSUB 40000: IF ZN$ <  > "" THEN D2 = ZN
2325 LO = 0.05  :HI = 5
2330  IF D2 < LO OR D2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2315
2335  GOSUB 40210
2340 LQ = 20:LN = 20: GOSUB 40
2345  GOSUB 40000: IF ZN$ <  > "" THEN S2 = ZN
2350 LO = 0.01:HI = 2!
2355  IF S2 < LO OR S2 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 2340
2360  REM
2370  GOSUB 40210:CX = 1:CY = CV + LN + 2: GOSUB 42
2380  GOSUB 41 : GOSUB 51
2390  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR CTRL-Q = QUIT ENTIRE ANALYSIS";
2410  GOSUB 50 : PRINT " ";
2420 GOSUB 40610
2430 REM
2440  IF  Z$ = QE$ THEN 42900
2450  IF Z$ = "N" THEN CX = 1:CY = CY: GOSUB 42: GOSUB 45: GOTO 1468
2460  IF Z$ <  > "Y" THEN PRINT BL$ : GOTO 2370
2470  GOSUB 48700
2480 RETURN
2490 REM -----------------END DATA ENTRY --------------------
3000 REM -----INITIAL DESCRIPTION SUB ----------------------
3010 LQ$(1) = "    GRAINDRY evaluates the drying, pricing & storage profits potential"
3020 LQ$(2) = "of four marketing alternatives compared to delivering the crop wet at harvest."
3025 LQ$(3) = " "
3030 LQ$(4) = "The alternatives are (1) DELIVER (SELL) DRY AT HARVEST,"
3040 LQ$(5) = "                     (2) STORE AND PRICE LATER ON THE CASH MARKET,"
3050 LQ$(6) = "                     (3) STORE AND PRICE (HEDGE) BY CONTRACT AND"
3055 LQ$(7) = "                     (4) STORE AND HEDGE ON THE FUTURES MARKET."
3060 LQ$(8) = " "
3062 LQ$(9) = "   In addition it calculates a comparable grain storage cost table to"
3064 LQ$(10) = "assist in re-evaluating the initial assumptions of the proper time to store."
3066 GOSUB 38
3070 FOR I = 1 TO 10
3080 IF PQ$ = "Y" THEN LPRINT LQ$(I):GOTO 3100
3090 PRINT LQ$(I) : IF PR$ = "Y" THEN LPRINT LQ$(I)
3100 NEXT I
3110  PRINT : GOSUB 49000
3120 RETURN
3130 REM -----------END DESCRIPTION SUB --------------------------
4000 REM -----STORAGE COST TABLE CALC & SCREEN SUB -------------------
4010 REM
4020 REM
4030 REM
4040 A(2) = O1
4050 B = 0.25
4060 A(1) = A(2) - B
4070 A(3) = A(2) + B
4080 A(4) = A(2) + B * 2
4090 FOR I = 1 TO 10
4100 FOR J = 1 TO 4
4110 F(I,J) = D1 + S1 * I * A(J) * 100! + ((1+ R1) ^ I-1) * (A(J) * 100!)
4115 E(I,J) = A(J) + F(I,J)/100
4120 NEXT J
4130 NEXT I
4140 GOSUB 38
4150 PRINT "Expected Grain Value per Bushel at Storage Decision Time"
4160 PRINT
4170 PRINT"Handling + Storage Loss + Time Related Interest Costs Due to Holding The Grain"
4180 PRINT
4190 PRINT "        Value per Bushel in Dollars"
4200 PRINT USING "$/Bu.   ###.##    ###.##    ###.##    ###.##";A(1);A(2);A(3);A(4)
4210 PRINT
4220 PRINT "   On Farm Storage Cost By Months (in Cents / Bushel)"
4230 PRINT "Mo."
4240 FOR I = 1 TO 10
4250 PRINT USING "##      ###.##    ###.##    ###.##    ###.##";I;F(I,1);F(I,2);F(I,3);F(I,4)
4260 NEXT I
4270 PRINT
4280 GOSUB 49007
4290 PRINT
4300 PRINT "Required or Necessary Market Price by Months in Storage or by"
4310 PRINT "a Narrowing of the Basis in Order to Break Even by Storeing"
4320 PRINT
4330 PRINT "        Value per Bushel at the Time the Grain is Put Into Storage"
4340 PRINT USING "Mo.     ###.##    ###.##    ###.##    ###.##";A(1);A(2);A(3);A(4)
4350 PRINT
4360 FOR I = 1 TO 10
4400 PRINT USING "##      ###.##    ###.##    ###.##    ###.##";I;E(I,1);E(I,2);E(I,3);E(I,4)
4430 NEXT I
4440 PRINT
4450 PRINT " This Table assumes ";O2;"% Interest, Grain Damage of ";D2;" + ";S2;"% / Mo."
4460 GOSUB 49007
4470 IF PR$ = "Y" THEN GOSUB 4510
4480 RETURN
4490 REM ------------end grain storage cost screen sub -----------------
4500 REM ------------------
4510 REM --------BEGIN SUB TO PRINT STORAGE COST TABLE ----------
4550 LPRINT "Expected Grain Value per Bushel at Storage Decision Time"
4560 LPRINT
4570 LPRINT"Handling + Storage Loss + Time Related Interest Costs Due to Holding The Grain"
4580 LPRINT
4590 LPRINT "        Value per Bushel in Dollars"
4600 LPRINT USING "$/Bu.   ###.##    ###.##    ###.##    ###.##";A(1);A(2);A(3);A(4)
4610 LPRINT
4620 LPRINT "   On Farm Storage Cost By Months (in Cents / Bushel)"
4630 LPRINT "Mo."
4640 FOR I = 1 TO 10
4650 LPRINT USING "##      ###.##    ###.##    ###.##    ###.##";I;F(I,1);F(I,2);F(I,3);F(I,4)
4660 NEXT I
4670 LPRINT
4690 LPRINT
4700 LPRINT "Required or Necessary Market Price by Months in Storage or by"
4710 LPRINT "a Narrowing of the Basis in Order to Break Even by Storeing"
4720 LPRINT
4730 LPRINT "        Value per Bushel at the Time the Grain is Put Into Storage
4740 LPRINT USING "Mo.     ###.##    ###.##    ###.##    ###.##";A(1);A(2);A(3);A(4)
4750 LPRINT
4760 FOR I = 1 TO 10
4800 LPRINT USING "##      ###.##    ###.##    ###.##    ###.##";I;E(I,1);E(I,2);E(I,3);E(I,4)
4830 NEXT I
4840 LPRINT
4850 LPRINT " This Table assumes ";O2;"% Interest, Grain Damage of ";D2;" + ";S2;"% / Mo."
4860 RETURN
4870 REM -----END PRINT TABLE SUB ----------------
39450  REM   ---------------------------------------
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39485 RETURN
39490  REM  ----------------------------------------
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40400  REM   PROCEDURE TO PRINT LENGTH OF DATA PROMPT (REQUIRED OR MAXIMUM
40405  REM   PROPER USE REQUIRES POST GENBASIC CODING OF WL & FL'S
40410  PRINT  LEFT$ (SQ$,WL);
40420  IF FL > 0 THEN  PRINT "."; LEFT$ (SQ$,FL);
40430 CX = CH:CY = CV + LN: GOSUB 42
40440  RETURN
40450  REM   END PROCEDURAL SUB
40460  REM  ----------------------------------------
40500  REM    PROCEDURE TO VERIFY THE PROPER LENGTH OF CODED INPUT (ENTRY) * *
40510  IF  LEN (ZN$) = WL THEN  RETURN
40520  PRINT  CHR$ (7); CHR$ (7);
40530  GOSUB 41
40535  GOSUB 51
40537  PRINT "ENTRY IS CODED & MUST BE ";WL;" DIGITS LONG..RE-ENTER THE PROPER VALUE..."
40540  GOSUB 50
40541 CX = CH:CY = CV
40542  GOSUB 42: GOSUB 43
40550  GOSUB 40400
40560  GOSUB 40100
40570  GOTO 40010
40580  REM   END PROCEDURE
40590  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
41000 REM PROCEDURE TO COPY OVER A SEQUENTIAL FILE BEFORE ADDING DATA TO IT.
41010 ON ERROR GOTO 41900
41020 OPEN"I",#1,K$
41030 REM IF FILE EXISTS ,WRITE IT TI K1$
41040 OPEN "O",#2,K1$
41050 IF EOF(1) THEN 41090
41060 LINE INPUT #1,Z$
41070 PRINT #2,Z$
41080 GOTO 41050
41090 CLOSE#1
41100 REM WHEN TO KILL K$..BACKUP?
41110 RETURN
41200 REM ADD DATA TO #2
41300 REM CLOSE#2
41400 REM NAME K1$ AS K$ ?? HERE OR BEFORE CLOSE??
41900 REM CAPTURE NO FILE FOUND & START ONE AT THAT POINT
41910 IF ERR = 53 AND ERL =20 THEN OPEN"0",#2,K1$ : RESUME 41120
41920 ON ERROR GOTO 0
41930 REM----END FIE COPY PROCEDURE
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45565 PRINT : PRINT"DO NOT PANIC":PRINT "It is possible to recover from certain errors without losing any data.": PRINT "DO NOT EXIT FROM THIS PROGRAM.  Continue on for instructions."
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45675 LOCATE 7,5: PRINT"REMEDY/SUGGESTION:  ";RM$
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45677 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": GOSUB 46010
45684 RESUME 100
45685 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 3000
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 3000
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   10/22/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!  10/22/83                 IBM-PC    !"
47350  PRINT SPC(20)"!          GRAIN DRYSTORE             !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!  GRAIN DRYING AND STORAGE ANALYSIS  !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"! USING ALL UP TO DATE & CURRENT DATA !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   10/22/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   10/22/83              (IBM - PC)  !"
48310  LPRINT "!           GRAIN DRYSTORE            !"
48320  LPRINT "!                                     !"
48330  LPRINT "!  GRAIN DRYING AND STORAGE ANALYSIS  !"
48340  LPRINT "!                                     !"
48350  LPRINT "! USING ALL UP-TO-DATE & CURRENT DATA !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48750 REM*** CONVERTS INPUT OF LOWER CASE TO UPPER CASE
48755 IF K2$ = "" THEN RETURN
48760 I% = ASC(K2$)
48770 IF I% > 96 AND I% < 123 THEN K2$ = CHR$(I%-32)
48780 RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50:GOSUB 49007:RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$ = INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020 REM
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "?????? PUT A TITLE HERE"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149  K2 = 18
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 20 THEN 50300
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50170,50180,50190,50200,50210,50220,50230,50240,50250,50260,50270,50280,50290,50295
50108  GOTO 50300
50110  LQ$ = "The price, wet from the field at harvest time.  Recognizing hauling & delays?."
50119  GOTO 50300
50120  LQ$ = "Grain shrinks from .05% (wheat?) to .5% or more (corn?) per point H2O removed "
50129  GOTO 50300
50130  LQ$ = "Harvest usually does not start until 32%.  Some years it averages as low as 22%"
50139  GOTO 50300
50140  LQ$ = "12 to 13 % are common for small grains; 15.5% is standard for corn."
50149  GOTO 50300
50150  LQ$ = "Delivery point deduction per point moisture over that for the quoted price."
50159  GOTO 50300
50160  LQ$ = "A charge for handling & perhaps to cover overheads & profits?"
50169  GOTO 50300
50170  LQ$ = "More energy is involved in removing higher levels of moisture content in grain."
50179  GOTO 50300
50180  LQ$ = "The base energy etc drying charge for lower levels of moisture content."
50189  GOTO 50300
50190  LQ$ = "A marketing decision in itself.  Depends on outlook, odds, basis changes etc."
50199  GOTO 50300
50200  LQ$ = "Many elevators divide their charges this way to help cover handling & O.H.'s"
50209  GOTO 50300
50210  LQ$ = "The commerical charges which are related to time use of their facilities."
50219  GOTO 50300
50220  LQ$ = "If the grain is stored at a higher moisture it may go out of condition."
50229  GOTO 50300
50230  LQ$ = "If on had cash instead of grain, what interest (rate) could be saved or earned?"
50239  GOTO 50300
50240  LQ$ = "The outlook analysis or likely price for grain at the end of storage period."
50249  GOTO 50300
50250  LQ$ = "Call around to various elevators or other grain merchants to get a quote."
50259  GOTO 50300
50260  LQ$ = "From the day's close or from broker quotations."
50269  GOTO 50300
50270  LQ$ = "Use basis charts or better yet keep your own!"
50279  GOTO 50300
50280  LQ$ = "Total of 2 transactions costs + estimated interest on the margin account funds."
50289  GOTO 50300
50290  LQ$ = "Usually ranges from 0.2% to 0.5% for small grains & 1.0% to 3.0% for corn."
50294  GOTO 50300
50295  LQ$ = "Usually ranges from 0.05% to 0.1% for small grains & 0.3% to 1.0% for corn/mo."
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50302 REM
50304 REM
50310 PRINT LQ$; : GOSUB 50 : GOSUB 40610 : RETURN
53025 REM ------------------------------------------

FARMBID.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF FARMBID 03/19/84 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 SM$ = CHR$(15) : BG$ = CHR$(18)
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70 DIM QQ$(20) , LQ$(11)
80 GOSUB 5000
90  GOSUB 47300
100  GOSUB 46000
110 PRINT
120 PRINT "        There Are Two Major Input and Use Options:"
130 PRINT "         1 = Do a Bare Land Analysis (On a per acre or whole farm basis),"
140 PRINT "         2 = Do a Whole Operating Farm Unit Analysis (With livestock ? )."
150 PRINT "        Which Option ( 1 or 2 ) "; : INPUT K9
160 IF K9 < 1 OR K9 > 2 THEN 150
170  REM
180  REM   ARTICLE NOMENS ARE: GNI,CC,ANI,MTR,INF,P,T*,DP,IR,N,T
190  REM   FOLLOWS JIM KELLY MINNESOTA TI VERSION OF OHIO STATE
200  REM   WORK OF LEE & RASK. ALSO SEE ROY BLACK MICH STATE UNIV
210  REM   TELCAL 08 FOR TI 59-VERSION MATERIALS.
220  REM   MINN-AID DEVELOPMENT BY EARL FULLER U/MINN MAR 1979
230  REM   A APPLEII (APPLESOFT) VERSION  AND A
240  REM   FIRST CUT AT VALUE OF A WHOLE FARM VERSION
250  REM   DEVELOPED ADDITIONAL WHOLE FARM OPTION MARCH 1980
260  REM   A DECAID VERSION WAS DEVELOPED IN THE SUMMER 1979
270  REM   BY BOB CRAVENS WITH ADDED SENSIVITY ANALYSIS.
280  REM   AN AG EXP. STAT. PROJ. 14-36 & AG EXT SERVICE OFFERING
290  REM   COMPUTER TIME FOR DEVELOPMENT PROVIDED BY A UCS GRANT
300  REM   SENSIVITY ANALYSIS OF INFLATION & GROWTH RATES VERSION
310 K2 = 0
320 S3 = 0.1
460  GOSUB 5300
510  REM IF K9 = 1 THEN 870
1250  REM
1320  IF X1 < 1 GOTO 1340
1330 X1 = X1 * 0.01
1340  IF X2 < 1 GOTO 1360
1350 X2 = X2 * 0.01
1360  IF X4 < 1 GOTO 1380
1370 X4 = X4 * 0.01
1380  IF X5 < 1 GOTO 1400
1390 X5 = X5 * 0.01
1400  IF X7 < 1 GOTO 1420
1410 X7 = X7 * 0.01
1420  IF X8 < 0 GOTO 1440
1430 X8 = X8 * 0.01
1440  IF X9 > 0 GOTO 1460
1450 X9 = 0.01
1460  IF X9 < 1 GOTO 1480
1470 X9 = X9 * 0.01
1480 REM
1555  GOSUB 38
1590  IF K9 = 1 THEN 1713
1600  REM   CALCULATE  BARE LAND MARGIN EQUIVALENT VALUE (=X3 = ITEM 1)
1610 C3 = W1 + W2 + W6 - W3 - W4 - W5 + W6 - W9
1620 C7 = W7 - W8
1630  REM   DEDUCT BEFORE TAX EQUIVALENT OF  CAP. GAINS
1640  IF X4 < = 0! THEN 1670
1650 C7 = ( - W8 / (1 - X4)) + X7 * W7 + ((1 - X7) * W7) / (1 - X4)
1660  REM   END INPUT & START ANALYSIS SUBROUTINE
1670 X3 = C3 + C7
1680  PRINT
1682  PRINT SPC(20)"THE CALCULATED BEFORE TAX EQUIVALENT"
1684  PRINT SPC(20);A$
1686  PRINT SPC(20)"IS COMPUTED TO BE $"; INT (0.5 + X3)
1688 IF PR$ <> "Y" THEN 1713
1689 LPRINT
1690 LPRINT SPC(20)"THE CALCULATED BEFORE TAX EQUIVALENT"
1700 LPRINT SPC(20);A$
1710 LPRINT SPC(20)"IS COMPUTED TO BE $"; INT (0.5 + X3)
1713 REM
1714 K2 = 0
1715 S1 = 0:S2 = 0
1720 Y1 = 1 + X1
1730 Y2 = 1 + X2
1740 Z2 = Y2 ^ I2
1750 Y5 = 1 + X5
1760 Y8 = 1 - X8
1770 Y9 = 1 + X9
1780 Z9 = Y9 ^ I2
1790  REM
1800 A2 = ((Y5 / Y2) ^ I1) * (X6 * (1 - X7))
1810  REM
1820 B2 = (Z2 - 1) / (X2 * Z2)
1830 B3 = (X9 * Z9) / (Z9 - 1)
1840 B4 = Y8 * X4 * X9
1850 C2 = X7 / Y2 ^ I1
1860  FOR I = 1 TO I1
1870 S1 = S1 + (Y1 / Y2) ^ I
1880  NEXT I
1890  FOR I = 1 TO I2
1900 T1 = I2 - I + 1
1910 S2 = S2 + (1 / Y2 ^ I) * ((Y9 ^ T1) - 1) / (X9 * (Y9 ^ T1))
1920  NEXT I
1930 D1 = X8 + (Y8 * B2 * B3) - (B4 * B3 * S2) - C2
1940 Y3 = X3
1950  IF K2 = 2 THEN 1970
1955 K2 = 0
1960 Y3 = X3 - X3 * S3
1962 Y4 = 0
1964 Y$ = " ( 10% LESS THAN "
1966 Z$ = "ORGINALLY ASSUMED) "
1967 REM
1970 S4 = S1 * Y3 * (1 - X4)
1980 V = (S4 + A2) / D1
1990  IF K2 = 2 THEN RETURN
2000  REM RETURN
2010 REM
2020 R = X9 * (1 - X4)
2030 P = Y3 * (1 - X4)
2040 P = P * ((1 + R) ^ I2 - 1) / ((1 + R) ^ I2 * R)
2050 PRINT
2052  PRINT SPC(20)"A CURRENT NET MARGIN OF $ "; INT (0.5 + Y3)
2054  PRINT SPC(20);Y$;: PRINT Z$
2056  PRINT SPC(20)" COVERS A $ "; INT (0.5 + P);" LOAN"
2058  PRINT SPC(20)"THE MAXIMUM BID PRICE WOULD BE $"; INT (0.5 + V)
2060  IF PR$ <> "Y" THEN 2100
2062  LPRINT
2070  LPRINT SPC(20)"A CURRENT NET MARGIN OF $ "; INT (0.5 + Y3)
2072  LPRINT SPC(20);Y$;: PRINT Z$
2074  LPRINT SPC(20)" COVERS A $ "; INT (0.5 + P);" LOAN"
2080  REM   THE MAXIMUM BID PRICE PER UNIT WOULD BE $#######.##.
2090  LPRINT SPC(20)"THE MAXIMUM BID PRICE WOULD BE $"; INT (0.5 + V)
2100 Y3 = Y3 + X3 * S3
2102 Y$ = " ( AS "
2104 Y4 = Y4 + 1
2106  IF Y4 > 1 THEN Y$ = " ( 10% MORE THAN "
2110  IF Y3 <  = X3 * (1 + S3) + 1 GOTO 1970
2120  PRINT
2130 S1 = 0
2140 S2 = 0
2155   PRINT : GOSUB 51
2160  PRINT "0 = QUIT ; 1 = REVISE DATA ; 2 = DO A SENSITIVITY ANALYSIS TO GROWTH RATES";
2170  GOSUB 50
2190  INPUT K2
2200  IF K2 = 0 THEN  GOTO 100
2210  IF K2 = 1 THEN 460
2215  GOSUB 38
2220 B$ = "          EFFECT OF VARIATION IN THE ANTICIPATED RATES OF LAND INFLATION"
2230 C$ = "          AND FUTURE GROWTH IN NET INCOME ON THE MAXIMUM BID PRICE / UNIT."
2240 H$ = "                           ASSUMED LAND VALUE INFLATION RATES"
2245 E$ = "          WHEN GIVEN A CURRENT NET RETURN TO PAY FOR THE LAND OF $ "
2250 Z1 = X1
2260 Z5 = X5
2262 X5 = Z5 - 0.04
2264  IF X5 >  = 0.01 GOTO 2268
2266 X5 = 0.01
2268  REM   GROWTH   ###### #
2270  PRINT H$
2280  PRINT : PRINT
2282  PRINT B$
2284  PRINT C$
2286  PRINT E$; INT (X3 + 0.5)
2288  PRINT
2290  PRINT H$
2292  PRINT USING "INCOME       ## %";X5*100;
2294 IF PR$ <> "Y" THEN 2420
2300 LPRINT  : LPRINT
2310 LPRINT B$
2320 LPRINT C$
2340 LPRINT E$; INT (X3 + 0.5)
2350 LPRINT
2360 LPRINT H$
2410 LPRINT USING "INCOME       ## %";X5*100;
2420  FOR J9 = 2 TO 5
2430 X5 = X5 + 0.02
2450  PRINT USING "         ## %";X5*100;
2455 IF PR$ = "Y" THEN PRINT USING "         ## %";X5*100;
2460  NEXT J9
2465 PRINT : PRINT "GROWTH"
2470  PRINT " RATES"; TAB( 28);"MAXIMUM BID PRICE; $/UNIT"
2475 IF PR$ <> "Y" THEN 2490
2480 LPRINT : LPRINT "GROWTH"
2485  LPRINT " RATES"; TAB( 28);"MAXIMUM BID PRICE; $/UNIT"
2490 X1 = Z1 - 0.04
2500  IF X1 >  = 0.01 GOTO 2520
2510 X1 = 0.01
2520  FOR I9 = 1 TO 5
2530 X5 = Z5 - 0.04
2540  IF X5 >  = 0.01 GOTO 2560
2550 X5 = 0.01
2560  PRINT : PRINT USING "## %" ;X1*100;
2565  IF PR$ = "Y" THEN LPRINT : LPRINT USING "## %" ;X1*100;
2590  FOR J9 = 1 TO 5
2600 S1 = 0
2610 S2 = 0
2620  GOSUB 1720
2630 PRINT USING "   ##########";V;
2635 IF PR$ = "Y" THEN LPRINT USING "   ##########";V;
2640 X5 = X5 + 0.02
2650  NEXT J9
2660  PRINT
2665 IF PR$ = "Y" THEN LPRINT
2670 X1 = X1 + 0.02
2680  NEXT I9
2690  PRINT
2695 IF PR$ = "Y" THEN LPRINT
2700 S1 = 0
2710 S2 = 0
2720 X1 = Z1
2730 X5 = Z5
2740 GOSUB 49007
2750 GOTO 100
2760 REM --------------END MAIN PROCEDURE AND RESULTS -------------
2770  REM  ? DEF FNM(Y,Z)
5000  REM ---------------------------------------------------------------
5010 K2 = 20:CH = 47
5015  REM  DEFAULT DATA VALUES FOR THIS INPUT SECTION
5020 W1 = 1200 : QQ$(1) = "NET TAX AMTOUNT OF LIVESTOCK FOR RESALE .($) "
5025 W2 = 52000!:QQ$(2) = "ORDINARY TAXABLE FARM SALES/INCOME.......($) "
5030 W3 = 1500 : QQ$(3) = "FARM INTEREST EXCEPT MORTGAGE/CONTRACT ..($) "
5035 W4 = 26000 :QQ$(4) = "ORDINARY FARM EXPENSE EXCEPT INTEREST ...($) "
5040 W5 = 3000 : QQ$(5) = "PROJECTED FARM DEPRECIATION/REPLACEMENT .($) "
5045 W6 = 1000 : QQ$(6) = "ENTER PROJECTED ANNUAL NON-FARM INCOME ..($) "
5050 W7 = 1300 : QQ$(7) = "ENTER TYPICAL YEARLY CAP. GAINS INCOME...($) "
5055 W8 = 6000 : QQ$(8) = "OTHER ANNUAL CAPITAL REPAYMENTS..........($) "
5060 W9 = 11000 :QQ$(9) = "ANNUAL FAMILY LIVING + INCOME TAXES......($) "
5065 X3 = 6846 :QQ$(10) = "ANNUAL NET MARGIN/UNIT TO PAY FOR LAND ..($) "
5070 X1 = 5 :   QQ$(11) = "ENTER PROJECTED GROWTH IN NET INCOME.....(%) "
5075 X5 = 5 :   QQ$(12) = "ENTER PROJECTED INFLATION IN LAND VALUES.(%) "
5080 X8 = 25 :  QQ$(13) = "DOWN PAYMENT AS PCT. OF PURCHASE PRICE ..(%) "
5085 X9 = 10 :  QQ$(14) = "INTEREST RATE ON BORROWED FUNDS TO BUY ..(%) "
5090 I2 = 25 :  QQ$(15) = "LOAN AMORTIZATION PERIOD IN .........(YEARS) "
5095 I1 = 25 :  QQ$(16) = "ENTER YEARS OF PLANNED OWNERSHIP (SPAN?).... "
5100 X4 = 30 :  QQ$(17) = "PROJECTED TYPICAL MARGINAL TAX RATE IN ..(%) "
5105 X7 = 25:QQ$(18) = "ENTER CAPITAL GAINS TAX RATE IN (%)......... "
5110 X2 = 10:QQ$(19) = "ENTER MIN. AFTER TAX OPPORT. RETURN RATE (%) "
5115 X6 = 12500:QQ$(20) = "ENTER AREA COMPARABLE UNIT LAND PRICE....... "
5120 A$ = " ANNUAL NET MARGIN/UNIT TO PAY FOR LAND"
5125 RETURN
5130 P$ = " PCT "
5135 REM -------END DEFAULT DATA & INPUT SETUP SUB
5140 REM ----------------------------------------------------------------
5300  REM --------BEGIN DATA ENTRY ---------------------------
5320  GOSUB 38: GOSUB 51
5340  PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
5360  GOSUB 50
5380  GOSUB 39
5390  IF K9 = 1 THEN 5760
5400  PRINT
5420  PRINT QQ$(1);W1
5440  PRINT
5460  PRINT QQ$(2);W2
5480  PRINT
5500  PRINT QQ$(3);W3
5520  PRINT
5540  PRINT QQ$(4);W4
5560  PRINT
5580  PRINT QQ$(5);W5
5600  PRINT
5620  PRINT QQ$(6);W6
5640  PRINT
5660  PRINT QQ$(7);W7
5680  PRINT
5700  PRINT QQ$(8);W8
5720  PRINT
5740  PRINT QQ$(9);W9
5742  IF S9 = 4 THEN  GOSUB 49007 : GOTO 6620
5750  IF K9 = 2 THEN 5800
5760  PRINT
5780  PRINT QQ$(10);X3
5782  IF S9 = 4 THEN  GOSUB 49000: GOTO 6620
5800  GOSUB 41: GOSUB 49910
5802  IF S9 = 4 THEN  GOSUB 49000: GOTO 6620
5810  GOSUB 40210
5815  IF K9 = 1 THEN LN = 0: GOTO 6360
5820 LQ = 1:LN = 2: GOSUB 40
5840  GOSUB 40000: IF ZN$ <  > "" THEN W1 = ZN
5860  GOSUB 40210
5880 LQ = 2:LN = 4: GOSUB 40
5900  GOSUB 40000: IF ZN$ <  > "" THEN W2 = ZN
5920  GOSUB 40210
5940 LQ = 3:LN = 6: GOSUB 40
5960  GOSUB 40000: IF ZN$ <  > "" THEN W3 = ZN
5980  GOSUB 40210
6000 LQ = 4:LN = 8: GOSUB 40
6020  GOSUB 40000: IF ZN$ <  > "" THEN W4 = ZN
6040  GOSUB 40210
6060 LQ = 5:LN = 10: GOSUB 40
6080  GOSUB 40000: IF ZN$ <  > "" THEN W5 = ZN
6100  GOSUB 40210
6120 LQ = 6:LN = 12: GOSUB 40
6140  GOSUB 40000: IF ZN$ <  > "" THEN W6 = ZN
6160  GOSUB 40210
6180 LQ = 7:LN = 14: GOSUB 40
6200  GOSUB 40000: IF ZN$ <  > "" THEN W7 = ZN
6220  GOSUB 40210
6240 LQ = 8:LN = 16: GOSUB 40
6260  GOSUB 40000: IF ZN$ <  > "" THEN W8 = ZN
6280  GOSUB 40210
6300 LQ = 9:LN = 18: GOSUB 40
6320  GOSUB 40000: IF ZN$ <  > "" THEN W9 = ZN
6330  IF K9 = 2 THEN 6400
6340  GOSUB 40210
6360 LQ = 10:LN = LN + 2: GOSUB 40
6380  GOSUB 40000: IF ZN$ <  > "" THEN X3 = ZN
6400  REM
6420  GOSUB 40210:GOSUB 41
6440  GOSUB 51
6460  PRINT "DATA OK? WANT TO GO AHEAD (Y OR N OR <CNTL-Q> = QUIT ENTIRE ANALYSIS)";
6500  GOSUB 50
6520 GOSUB 40610
6560  IF Z$ = QE$ THEN 42900
6580  IF Z$ = "N" THEN CX = 1: GOSUB 42: GOSUB 45: GOTO 5810
6600  IF Z$ <  > "Y" THEN 6420
6620  REM  END THIS INPUT SECTION
7300  REM --- BEGIN 2ND SCREEN OF INPUT ---------------------
7320  GOSUB 38: GOSUB 51
7340  PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
7360  GOSUB 50
7380  GOSUB 39
7400  PRINT
7420  PRINT QQ$(11);X1
7440  PRINT
7460  PRINT QQ$(12);X5
7480  PRINT
7500  PRINT QQ$(13);X8
7520  PRINT
7540  PRINT QQ$(14);X9
7560  PRINT
7580  PRINT QQ$(15);I2
7600  PRINT
7620  PRINT QQ$(16);I1
7640  PRINT
7660  PRINT QQ$(17);X4
7680  PRINT
7700  PRINT QQ$(18);X7
7720  PRINT
7740  PRINT QQ$(19);X2
7760  PRINT
7780  PRINT QQ$(20);X6
7782  IF S9 = 4 THEN  GOSUB 49007: GOTO 8630
7800  GOSUB 41: GOSUB 49910
7810  GOSUB 40210
7820 LQ = 11:LN = 2: GOSUB 40
7840  GOSUB 40000: IF ZN$ <  > "" THEN X1 = ZN: GOSUB 43
7845 LO = -50 : HI = 50
7850 IF X1 < LO OR X1 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 7820
7860  GOSUB 40210
7880 LQ = 12:LN = 4: GOSUB 40
7900  GOSUB 40000: IF ZN$ <  > "" THEN X5 = ZN: GOSUB 43
7905 LO = -50 : HI = 50
7910 IF X5 < LO OR X5 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 7880
7920  GOSUB 40210
7940 LQ = 13:LN = 6: GOSUB 40
7960  GOSUB 40000: IF ZN$ <  > "" THEN X8 = ZN: GOSUB 43
7965 LO = 0   : HI = 100
7970 IF X8 < LO OR X8 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 7940
7980  GOSUB 40210
8000 LQ = 14:LN = 8: GOSUB 40
8020  GOSUB 40000: IF ZN$ <  > "" THEN X9 = ZN: GOSUB 43
8025 LO = 0   : HI = 35
8030 IF X9 < LO OR X9 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 8000
8040  GOSUB 40210
8060 LQ = 15:LN = 10: GOSUB 40
8080  GOSUB 40000: IF ZN$ <  > "" THEN I2 = ZN: GOSUB 43
8085 LO = 0   : HI = 40
8090 IF I2 < LO OR I2 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 8060
8100  GOSUB 40210
8120 LQ = 16:LN = 12: GOSUB 40
8140  GOSUB 40000: IF ZN$ <  > "" THEN I1 = ZN: GOSUB 43
8145 LO = 0   : HI = 40
8150 IF I1 < LO OR I1 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 8120
8160  GOSUB 40210
8180 LQ = 17:LN = 14: GOSUB 40
8200  GOSUB 40000: IF ZN$ <  > "" THEN X4 = ZN: GOSUB 43
8205 LO = 0   : HI = 70
8210 IF X4 < LO OR X4 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 8180
8220  GOSUB 40210
8240 LQ = 18:LN = 16: GOSUB 40
8260  GOSUB 40000: IF ZN$ <  > "" THEN X7 = ZN: GOSUB 43
8265  IF X7 < 0.4 * X4 THEN  GOSUB 41: GOSUB 51: PRINT  CHR$ (7);: PRINT "MUST BE AT LEAST 40% OF TOTAL MARGINAL  TAX RATE": GOSUB 50:GOTO 8240
8280  GOSUB 40210
8300 LQ = 19:LN = 18: GOSUB 40
8320  GOSUB 40000: IF ZN$ <  > "" THEN X2 = ZN: GOSUB 43
8325 LO = 3   : HI = 50
8330 IF X2 < LO OR X2 > HI THEN GOSUB 40150 : GOSUB 40 : GOTO 8300
8340  GOSUB 40210
8360 LQ = 20:LN = 20: GOSUB 40
8380  GOSUB 40000: IF ZN$ <  > "" THEN X6 = ZN: GOSUB 43
8400  REM
8420  GOSUB 40210:GOSUB 41
8440  GOSUB 51
8460  PRINT "DATA OK? WANT TO GO AHEAD (Y OR N OR <CNTL-Q> = QUIT ENTIRE ANALYSIS)";
8500  GOSUB 50
8520 GOSUB 40610
8560  IF Z$ = QE$ THEN 42900
8580  IF Z$ = "N" THEN 7810
8600  IF Z$ <  > "Y" THEN 8420
8630  GOSUB 48700
8640  RETURN
8645 REM -------------END DATA ENTRY SUB --------------------
8650 REM --------------------------------------------------------
9000 REM ----------begin initial screen sub ---------------------
9010 GOSUB 38
9020 LQ$(1)="   FARMBID estimates the the maximum price you can bid for either (a) bare land"
9030 LQ$(2) = "or (b) a complete farm unit including, if appropriate, livestock facilities."
9040 LQ$(3) = "It considers inflation, the gross margin generated from crops & livestock,"
9045 LQ$(4) = "cost of funds, sources of funds, income taxes, credit arrangements and"
9050 LQ$(5) = "planning span or expected ownership period.
9060 LQ$(6) = " "
9070 LQ$(7) = "   The approach is the same as is used in the DECAID LANDBUY and other"
9080 LQ$(8) = "simular models that follow the work of Lee & Rask, Ohio State University."
9090 LQ$(9) ="A first time user should list out the questionaire and study the questions"
9100 LQ$(10)= "and their footnotes (on-line helps) before trying to process actual data."
9110 LQ$(11)= "A run through of the sample data in option 2 will also help."
9120 FOR I = 1 TO 11
9130 IF PQ$ = "Y" THEN LPRINT LQ$(I) :LPRINT : GOTO 9150
9140 IF PR$ <> "Y" THEN PRINT LQ$(I) ELSE LPRINT LQ$(I)
9145  IF I <> 6 THEN PRINT
9150 NEXT I
9160 GOSUB 49007
9180 RETURN
9190 REM ---------------end initial screen sub -------------------
39450  REM   ---------------------------------------
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39482 REM
39485 RETURN
39490  REM  ----------------------------------------
39560  REM   END PROCEDURE TO USE ? PRINTER
39570  REM
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN GOTO 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": Z$ = INPUT$(1)
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 9010
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 9010
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
46160 REM
46170 REM
46180 REM
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   12/10/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49007
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   12/10/83              IBM - PC    !"
47344  PRINT SPC(20)"!                                     !"
47350  PRINT SPC(20)"!             FARM-BID                !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"! DECISION AID TO HELP DETERMINE THE  !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"! MAXIMIUM BID PRICE $/UNIT FOR LAND  !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   12/10/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   12/10/83              (IBM - PC)  !"
48310  LPRINT "!              FARM-BID               !"
48320  LPRINT "!                                     !"
48330  LPRINT "!  DECISION AID TO HELP DETERMINE THE !"
48340  LPRINT "!                                     !"
48350  LPRINT "!  MAXIMUM BID PRICE $/UNIT FOR LAND  !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50 : GOSUB 49007 : RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "FARM-BID  A calculator of the maximum affordable price for farm land."
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149 K2 = 20
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 20 GOTO 50200
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50170,50180,50190,50200,50210,50220,50230,50240,50250,50260,50270,50280,50290,50295
50108  GOTO 50300
50110  LQ$ = "livestock purchased for resale sales (1040F) is source."
50119  GOTO 50300
50120  LQ$ = "1040F source of all ordinary farm income (cash sales)."
50129  GOTO 50300
50130  LQ$ = "1040F interest except for the land payment interest - note next question."
50139  GOTO 50300
50140  LQ$ = "1040F all other ordinary farm expenses except interest - see last question."
50149  GOTO 50300
50150  LQ$ = "Either 1040F tax deprediation or a normal asset replacement allowance."
50159  GOTO 50300
50160  LQ$ = "Non-farm income available to make land payments and/or pay other expenses."
50169  GOTO 50300
50170  LQ$ = "On livestock farms capital gain sales are often big enough to effect tax costs"
50179  GOTO 50300
50180  LQ$ = "Other than land capital repayments - a demand on cash."
50189  GOTO 50300
50190  LQ$ = "Family living ($11000-22000 are common) + income taxes require cash."
50199  GOTO 50300
50200  LQ$ = "Gross margin after crop expense or its equivelant on a livestock farm."
50205  GOTO 50300
50210  LQ$ = "A critical value to the analysis as it influences the maximum bid price a lot."
50215  GOTO 50300
50220  LQ$ = "A critical value to the analysis as it influences the maximum bid price a lot."
50225  GOTO 50300
50230  LQ$ = "Even if a set dollar amount is involved , a percentage must still be entered."
50235  GOTO 50300
50240  LQ$ = "If no certain try an average rate for a even payment schedule."
50245  GOTO 50300
50250  LQ$ = "Needed to compute loan payments & interest plus their tax effects."
50255  GOTO 50300
50260  LQ$ = "Needed to discount eventual sale value, taxes, interest, & gross margin."
50265  GOTO 50300
50270  LQ$ = "Sum of the federal rate + social security + (1-fed taxs rate) * state rate"
50275  GOTO 50300
50280  LQ$ = "Currently running 40% of the marginal tax rate, but laws do change."
50285  GOTO 50300
50290  LQ$ = "Next best opportunity cost of equity put in this land consider risk etc."
50292  GOTO 50300
50295  LQ$ = "Value of a unit of the same productivity in the same land market area."
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50302 REM
50304 REM
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN
53025 REM ------------------------------------------

FEEDPIGS.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF FEEDPIGS 03/18/84 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
24 REM
25 REM
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
67  GOSUB 47300: GOSUB 38: PRINT : PRINT
69 DIM A(15),B(15),C(12,2),D(20),E(9),S(12,2),T(5,5)
70 DIM QQ$(19),RR(19),L$(39),R$(10),RR$(5),LQ$(19)
80  GOSUB 5000
90 GOSUB 47300
100 REM
110 GOSUB 46000
120 GOSUB 6020
130 REM
140 GOSUB 6965
315 PRINTE(I);I;
350  PRINT
360  PRINT
370 W1 = 1
380 S1 = 0
385 K1 = 0
387 REM GOTO 5000
445  REM
587 E6 = E(6) + (E(4) - A(6)) * E(8)
588 E7 = E(7) + (E(4) - A(6)) * E(9)
589 A6 = A(6)
590  IF A(1) = 180 THEN 650
600 I =  INT ((A(1) - 171) / 10)
610 W2 = A(1) - (I * 10 + 170)
620 A(7) = E6 + C(I,1) + W2 * C(I,2)
630 A(9) = E7 + S(I,1) + W2 * S(I,2)
640  GOTO 670
650 A(7) = E6
660 A(9) = E7
670 A(8) = A(7) / 56
680 A(10) = A(9) / 100
690 W3 = (A(7) + A(9)) / (A(1) - A6)
700 W3 =  INT ((W3 + 0.005000001) * 100) / 100
710 W4 =  INT ((A(8) + 0.005000001) * 100) / 100
720 W5 =  INT ((A(9) + 0.005000001) * 100) / 100
730 A(11) =  INT ((((A(1) - A6) / 180) * E(1) + 0.005000001) * 100) / 100
740 A(12) =  INT ((((A(1) - A6) / 180) * E(2) + 0.005000001) * 100) / 100
750 A(13) = E(3)
760 IF FLAG = 5 THEN RETURN
890  IF  LEFT$ (R$(5),1) = "Y" THEN 999
895  IF K1 > 0 GOTO 1052
912 A(7) = A(8) * 56
950 A(10) = A(9) / 100
999  REM
1030 REM??????
1051 REM
1052 REM ????
1080 B(1) = A(1) * A(3) / 100
1090 B(2) = (A(14) / 100) * A(2)
1100 B(1) =  INT ((B(1) + 0.005000001) * 100) / 100
1110 B(2) =  INT ((B(2) + 0.005000001) * 100) / 100
1120 B(3) = B(1) - B(2)
1130 B(4) =  INT ((A(8) * A(4) + 0.005000001) * 100) / 100
1140 B(5) =  INT ((A(10) * A(5) + 0.005000001) * 100) / 100
1150 B(6) =  INT ((A(11) + 0.005000001) * 100) / 100
1160 B(7) = B(4) + B(5) + B(6)
1170 B(8) = A(2)
1190 B(10) =  INT ((A(12) + 0.005000001) * 100) / 100
1210 B(12) =  INT ((A(13) + 0.005000001) * 100) / 100
1220 B3 = B(8) + B(7) + B(10)
1222 B(11) =  INT (((B(8) * (E(5) / 365) * A(15) * 0.01) + 0.005000001) * 100) / 100
1224 B(13) = B3 + B(11)
1226 B(9) = B(13) + B(12)
1230 B(14) = B(3) - B(9)
1235 B(14) =  INT ((B(14) + 0.005000001) * 100) / 100
1240 B(15) = B(14) + B(12)
1250  REM   READY TO RUN REPORT (S)
1260  PRINT : GOSUB 38
1270  PRINT SPC(20)"***RESULTS FOR THE RUN FOLLOWS***"
1280  PRINT:PRINT:PRINT
1285  IF  LEFT$ (R$(1),1) = "N" THEN 2010
1300  PRINT L$(1);" "A(1);" POUNDS"
1310  PRINT
1320  PRINT L$(2)
1330  PRINT " ";A(1);" ";L$(3);A(3);L$(4); TAB(61) ;"$";B(1)
1350  PRINT L$(5);A(14);L$(6); TAB(63) ;B(2)
1380  PRINT L$(7); TAB(62);B(3)
1390  PRINT
1400  PRINT L$(8)
1410 W4 =  INT ((A(8) + 0.005000001) * 100) / 100
1420 W5 =  INT ((A(9) + 0.005000001) * 100) / 100
1430 W6 =  INT ((A(7) + 0.005000001) * 100) / 100
1440  PRINT " ";W6;L$(9);A(4);L$(11); TAB(62);B(4)
1450  PRINT "     (";W4;"BUSHELS OF CORN )"
1460  PRINT " ";W5;L$(12);A(5);L$(4); TAB(63);B(5)
1480  PRINT L$(13); TAB(63);B(6)
1510  PRINT L$(14); TAB(62);B(7)
1520  PRINT:PRINT:PRINT
1521 LOCATE ,23 :GOSUB 51:PRINT  " TABLE ONE CONTINUES ON NEXT SCREEN ":GOSUB 50
1525  GOSUB 49007 : GOSUB 38
1530  PRINT L$(15)
1570  PRINT L$(16);A(6);" LB.FEEDER PIG"; TAB(61);"$";B(8)
1580  PRINT L$(17); TAB(62);B(7)
1590  PRINT L$(18); TAB(63);B(10)
1600  PRINT L$(19);B(8);L$(20);;A(15);L$(21);E(5);" DAYS"; TAB(63);B(11)
1605  PRINT "    TOTAL FEED, CASH EXPENSE & PURCHASE COST"; TAB(62);B(13)
1610  PRINT L$(22); TAB(63);B(12)
1620  PRINT L$(23); TAB(62);B(9)
1630  PRINT
1640  PRINT L$(24)
1650  PRINT L$(25); TAB(62);B(14)
1660  PRINT L$(26);TAB(62);B(15)
1670  PRINT L$(27)
1690  REM   DATA STRING L$ FOR REPORTS
1970  REM   COMPUTE TABLE 2 DATA IF REQUESTED
2010  IF  LEFT$ (R$(2),1) = "N" THEN 2670
2015  GOSUB 49007 : GOSUB 38
2060  REM   NON-CORN COSTS TO BE COVERED IN TABLE 2
2070  IF D(1) = 1 THEN 2120
2080  IF D(1) = 2 THEN 2140
2090  IF D(1) = 3 THEN 2160
2100  PRINT "YOUR COST OPTION MUST BE 1, 2, OR 3"
2110  GOTO 1030
2120 D(2) = B(9) - B(8) - B(4)
2130  GOTO 2190
2140 D(2) = B(9) - B(8) - B(4) - B(12)
2150  GOTO 2190
2160 D(2) = B(9) - B(8) - B(4) - B(11) - B(12)
2170  REM   SET UP ROW-COLUMN HEADINGS FOR TABLE 2
2180  IF S1 = 1 THEN 2680
2190  FOR I = 1 TO 5
2200 D(I + 2) = A(4) - 0.45 + I * 0.15
2210 D(I + 7) = A(3) + (I - 3) * 2
2220  NEXT I
2230  REM   COMPUTE TABLE 2
2240  FOR J = 1 TO 5
2250  FOR I = 1 TO 5
2260 T(I,J) = (A(1) / 100) * D(I + 7)
2270 T(I,J) = T(I,J) - D(2) - A(8) * D(J + 2)
2280 T(I,J) = T(I,J) / (1! + (A(14) / 100))
2300  NEXT I
2310  NEXT J
2320  PRINT : PRINT
2410  PRINT L$(32)
2420 I = D(1) + 27
2430  PRINT L$(38);L$(I);")"
2440  PRINT
2450  PRINT L$(33);L$(34)
2460  PRINT L$(35);
2470  GOSUB 3200
2480  PRINT L$(36)
2490  LOCATE ,25 :GOSUB 51 : PRINT  L$(37);A(6);"-LB. FEEDER ":GOSUB 50
2495 PRINT
2500  FOR J = 1 TO 5
2505 IF J = 3 THEN PRINT "     ";:GOSUB 51:PRINT USING "###";D(J+7);:GOSUB 50 :PRINT "  :  "; : GOTO 2520
2510  PRINT  USING "     ###  :  ";D(J + 7);
2520  FOR I = 1 TO 5
2545 IF J = 3 AND I = 3 THEN PRINT "      ";:GOSUB 51:PRINT USING "###.##";T(J,I); : GOSUB 50 :GOTO 2560
2550  PRINT USING "      ###.##";T(J,I);
2560  NEXT I
2570  PRINT
2580  NEXT J
2620  PRINT
2630  IF S1 = 9 THEN 3050
2660  REM   READY FOR TABLE 3
2670  IF  LEFT$ (R$(3),1) = "N" THEN 3050
2675  IF PR$ = "N" THEN  GOSUB 49000
2680  REM   SET UP ROW-COL HEADINGS
2690  FOR I = 1 TO 5
2700 D(I + 2) = A(4) - 0.45 + I * 0.15
2710 D(I + 12) = A(2) + (I - 3) * 3
2720  NEXT I
2730  REM   BASE COSTS FOR TABLE 3
2740  IF D(1) = 1 THEN 2780
2750  IF D(1) = 2 THEN 2800
2760 D(2) = B(9) - B(8) - B(4) - B(11) - B(12)
2770  GOTO 2810
2780 D(2) = B(9) - B(8) - B(4)
2790  GOTO 2810
2800 D(2) = B(9) - B(8) - B(4) - B(12)
2810  REM   COMPUTE BREAK-EVEN MARKET PRICES
2820  FOR J = 1 TO 5
2830  FOR I = 1 TO 5
2840 T(I,J) = D(2) + D(J + 12) + W4 * D(I + 2)
2850 T(I,J) = (T(I,J) + A(2) * (A(14) / 100)) / (A(1) / 100)
2870  NEXT I
2880  NEXT J
2890  REM   PRINT TABLE 3
2900  PRINT
2909  GOSUB 38
2910  PRINT "TABLE 3.  BREAK-EVEN MARKET PRICES FOR A";A(1);"POUND HOG"
2920 I = D(1) + 27
2930  PRINT L$(38);L$(I);")"
2940  PRINT
2950  PRINT "WHEN THE PURCH.";L$(34)
2960  PRINT "COST OF ";A(6);"LB.";
2970  GOSUB 3200
2980  PRINT " FEEDERS ($) IS"
2990  PRINT TAB(25); :GOSUB 51:PRINT" THE BREAK-EVEN SALE PRICE $/HEAD IS ":GOSUB 50
2994 PRINT
3000 S1 = 9
3010  FOR I = 8 TO 12
3020 D(I) = D(I + 5)
3030  NEXT I
3040  GOTO 2500
3050 S1 = 0
3052  ON D(1) GOTO 3053,3060,3065
3053 D1 =  INT ((B(12) * 100 / A(1) + 0.005000001) * 100) / 100
3054  PRINT "  (SUBTRACT $ ";D1;" FROM EACH PRICE ABOVE TO COVER"
3055  PRINT  TAB( 2);"JUST ";L$(29)
3057  GOTO 3068
3060 D1 =  INT ((B(12) * 100 / A(1) + 0.005000001) * 100) / 100
3061  PRINT "  (ADD $ ";D1;" TO EACH PRICE ABOVE TO COVER"
3062  PRINT  TAB( 3);L$(28)
3063  PRINT
3064  GOTO 3068
3065 D1 =  INT (((B(11) + B(12)) * 100 / A(1) + 0.005000001) * 100) / 100
3066  GOTO 3061
3068  IF PR$ = "Y" THEN  GOSUB 39440
3069  PRINT : PRINT : PRINT "***END OF RUN -- DO YOU WANT ANOTHER (Y OR N)";
3070  INPUT R$(10) : K2$ = R$(10) : GOSUB 60400 : R$(10) = K2$
3080  PRINT
3090  IF  LEFT$ (R$(10),1) = "N" THEN 42902
3100 W1 = W1 + 1
3110  REM   READY FOR RE-RUN
3190 GOTO 1
3195  REM   END
3200  REM   SUB TO PRINT COL HEADS
3205 Z = POS(0):Z = Z-1:LOCATE ,Z
3210  FOR I = 3 TO 7
3213 IF I = 5 THEN PRINT "        "; : GOSUB 51 : PRINT USING "#.##";D(I); : GOSUB 50 : GOTO 3220
3215  PRINT  USING "        #.##";D(I);
3220  NEXT I: PRINT : RETURN
5000 RR$(1) = "N"
5005 RR$(2) = "N"
5010 RR$(3) = "Y"
5015 RR$(4) = "Y"
5020 RR$(5) = "Y"
5050 RR(1) = 220 : QQ$(1) = "ENTER THE PLANNED MARKET WEIGHT OF A HOG IN ........ POUNDS "
5060 RR(2) = 40 :  QQ$(2) = "ENTER THE PURCHASE WEIGHT OF A FEEDER PIG IN ....... POUNDS "
5070 RR(3) = 35 :  QQ$(3) = "ENTER THE PURCHASE PRICE PER FEEDER PIG IN ......... $/HEAD "
5080 RR(4) = 45 :  QQ$(4) = "ENTER THE PROJECTED MARKET PRICE OF HOGS IN ........ $/CWT. "
5090 RR(5) = 2.65 :QQ$(5) = "ENTER THE PRICE PER BUSHEL OF CORN; ON FARM VALUE ......($) "
5100 RR(6) = 13.5 :QQ$(6) = "ENTER THE PRICE FOR SOYBEAN MEAL HOG SUPPLEMENT/CWT.....($) "
5110 RR(7) = 15 :  QQ$(7) = "ENTER THE INTEREST RATE ON THE FEEDER PIGS IN ..... PERCENT "
5120 RR(8) = 3 :   QQ$(8) = "ENTER THE EXPECTED DEATH LOSS OF PIGS IN ...........PERCENT "
5130 QQ$(9) = "DO YOU WANT TO SEE THE FEED 'STANDARDS' USED (Y OR N)....... "
5140 QQ$(10) = "DO YOU WANT TO USE THE DEFAULT AMOUNT OF FEED FED/HOG (Y/N). "
5160 RR(11) = 10.3:QQ$(11)= "ENTER AMOUNT OF CORN TO REACH MARKET WEIGHT ....BUSHEL/HEAD "
5170 RR(12) = 90 :QQ$(12) = "ENTER AMT. OF SBM SUPPLEMENT TO REACH MARKET WEIGHTLBS/HEAD "
5180 RR(13) = 1.5:QQ$(13) = "ENTER COST PER HOG OF MINERALS AND ANTIBIOTICS ... $ / HEAD "
5190 RR(14) = 9! :QQ$(14) = "ENTER MISC. CASH OPERATING EXPENSE ................$ / HEAD "
5192 RR(15) =10! :QQ$(15) = "ENTER THE DESIRED RETURNS TO LABOR AND FACILITIES IN $/HEAD "
5194 RR(19) = 1! :QQ$(19) = "ENTER (1,2, OR 3) FOR THE DESIRED COST TO BE COVERED...(NO. "
5195 REM ---------------------------
5200 DATA   0,30,60.4375,91.25,122.4375,154.0625,185.8125
5205 REM   C = CORN NEEDS OVER 180 LBS.;S=SBM;A=INPUT;B=OUTPUT
5210 DATA   217.5265,249.4375,281.6875,316.125,350.1875
5220 DATA   3,3.04375,3.08125,3.11875,3.1625,3.175
5230 DATA   3.175,3.1875,3.225,3.44375,3.40625,3.3
5240 FOR J = 1 TO 2
5250 FOR I = 1 TO 12
5260 READ C(I,J)
5270 NEXT I
5280 NEXT J
5290 DATA   0,8,16.0625,24.25,32.5625,40.9375
5300 DATA   49.375,57.8125,66.3125,74.875,80.75,86.5
5310 DATA   .8,.80625,.81875,.83125,.8375,.84375
5320 DATA   .84375,.85,.85625,.5875,.575,.5625
5330 FOR J = 1 TO 2
5340 FOR I = 1 TO 12
5350 READ S(I,J)
5360 NEXT I
5370 NEXT J
5380 FOR I = 1 TO 9
5390 READ E(I)
5400 NEXT I
5410 DATA   1.50,8.00,8.00,40,122,437.562,57.437,1.45,0.55
5420 FOR I = 1 TO 39
5430 READ L$(I)
5440 NEXT I
5450 RETURN
5460 REM REMAINING DATA STATEMENTS ARE AT SCREEN PRINT LOCATIONS -----
5500  DATA   "TABLE 1.  BUDGET FOR A FEEDER PIG FED TO"
5510  DATA   "RECEIPTS:"
5520  DATA   "POUNDS AT $"
5530  DATA  " PER CWT."
5540  DATA  "  LESS "
5550  DATA  " PERCENT DEATH LOSS (VALUE) "
5560  DATA   "   GROSS RECEIPTS"
5570  DATA   "FEED REQUIREMENTS:"
5580  DATA  " LBS. OF CORN AT $"
5590  DATA   "BUSHELS) AT $"
5600  DATA  " PER BUSHEL"
5610  DATA  " LBS. OF SBM SUPPLEMENT AT $"
5620  DATA  "  MINERALS AND ANTIBIOTICS "
5630  DATA   "    TOTAL FEED VALUE PER HOG "
5640  DATA   "FEED & EXPENSE SUMMARY:"
5650  DATA   "  PURCHASE PRICE/HEAD FOR A "
5660  DATA   "  TOTAL FEED VALUE (FROM ABOVE)"
5670  DATA   "  ASSOCIATED CASH OPERATING EXPENSE"
5680  DATA   "  INTEREST ON $ "
5690  DATA   " AT "
5700  DATA   "% INTEREST FOR "
5710  DATA   "  DESIRED RETURNS TO LABOR & FACILITIES"
5720  DATA  "    ALL COSTS; INCLUDES DESIRED RETURNS (OVERHEADS)"
5730  DATA   "NET RETURN SUMMARY:"
5740  DATA   "  RETURN ABOVE FEED, EXPENSE & DESIRED RETURNS"
5750  DATA   "  GROSS MARGIN; RETURNS OVER DIRECT FEED + EXPENSE"
5760  DATA   "    (EXCLUDING DESIRED RETURNS)"
5770  DATA   "ALL EXPENSES & DESIRED RETURNS"
5780  DATA   "FEED & DIRECT CASH & INTEREST EXPENSE"
5790  DATA   "FEED & DIRECT CASH EXPENSES ONLY"
5800  DATA   "(WITHOUT OVERHEAD & DESIRED RETURNS)"
5830  DATA   "TABLE 2.  BREAK-EVEN FEEDER PIG PRICES PER HEAD"
5840  DATA   "WHEN THE SALE"
5850  DATA   "            AND WITH THE $/BUSHEL CORN PRICE AT"
5860  DATA   "PRICE IN $ PER "
5870  DATA   " CWT. IS"
5880  DATA   " YOU CAN PAY THIS $ PRICE PER "
5890  DATA   "          (TO COVER "
5900  DATA   "*********"
5990 REM --------END INITIALIZING SUB ------------------------
6000  REM
6010  REM  TO AVOID RE-DIMENSIONING ERRORS, DIM DECLARATIONS SHOULD BE MOVED TO THE 'TOP' OF THE PROGRAM
6020 I = 1:K2 = 19:CH = 62
6150  IF PQ$ = "Y" THEN  GOSUB 49110: RETURN
6160  REM  GOSUB 49100 TO PRINT A INPUT FORM ON PAPER.  (K2 = NO. OF QUESTIONS)
6170  GOSUB 38: GOSUB 51
6180  PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
6190  GOSUB 50
6200  GOSUB 39
6210  PRINT
6215 IF FLAG = 5 THEN RETURN
6220  PRINT QQ$(1);RR(1)
6230  PRINT
6240  PRINT QQ$(2);RR(2)
6250  PRINT
6260  PRINT QQ$(3);RR(3)
6270  PRINT
6280  PRINT QQ$(4);RR(4)
6290  PRINT
6300  PRINT QQ$(5);RR(5)
6310  PRINT
6320  PRINT QQ$(6);RR(6)
6330  PRINT
6340  PRINT QQ$(7);RR(7)
6350  PRINT
6360  PRINT QQ$(8);RR(8)
6405  IF S9 = 4 THEN  GOSUB 49007: GOTO 6840
6410  GOSUB 41: GOSUB 49910
6415  GOSUB 40210
6420 LQ = 1:LN = 2: GOSUB 40
6430  GOSUB 40000: IF ZN$ <  > "" THEN RR(1) = ZN
6440 LO = 180:HI = 300
6450  IF RR(1) < LO OR RR(1) > HI THEN  GOSUB 40150: GOSUB 40: GOTO 6420
6460  GOSUB 40210
6470 LQ = 2:LN = 4: GOSUB 40
6480  GOSUB 40000: IF ZN$ <  > "" THEN RR(2) = ZN
6490  GOSUB 40210
6500 LQ = 3:LN = 6: GOSUB 40
6510  GOSUB 40000: IF ZN$ <  > "" THEN RR(3) = ZN
6520  GOSUB 40210
6530 LQ = 4:LN = 8: GOSUB 40
6540  GOSUB 40000: IF ZN$ <  > "" THEN RR(4) = ZN
6550  GOSUB 40210
6560 LQ = 5:LN = 10: GOSUB 40
6570  GOSUB 40000: IF ZN$ <  > "" THEN RR(5) = ZN
6580  GOSUB 40210
6590 LQ = 6:LN = 12: GOSUB 40
6600  GOSUB 40000: IF ZN$ <  > "" THEN RR(6) = ZN
6610  GOSUB 40210
6620 LQ = 7:LN = 14: GOSUB 40
6630  GOSUB 40000: IF ZN$ <  > "" THEN RR(7) = ZN
6640  GOSUB 40210
6650 LQ = 8:LN = 16: GOSUB 40
6660  GOSUB 40000: IF ZN$ <  > "" THEN RR(8) = ZN
6730  REM
6740  GOSUB 40210: GOSUB 41
6750  GOSUB 51
6760  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR Q = QUIT ENTIRE ANALYSIS ";
6780  GOSUB 50
6790 GOSUB 40610
6810  IF Z$ = "Q" THEN 42900
6820  IF Z$ = "N" + CHR$(13) THEN 6415
6830  IF Z$ < > "Y" THEN 6740
6840  GOSUB 9000
6850  REM  DEFAULT DATA VALUES FOR THIS INPUT SECTION
6965 IF LEFT$(RR$(2),1) = "Y" THEN RR(11) = W4 : RR(12) = W5
6970  GOSUB 38: GOSUB 51
6980  PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
6990  GOSUB 50
7000  GOSUB 39
7010  PRINT
7020  PRINT QQ$(11);RR(11)
7030  PRINT
7040  PRINT QQ$(12);RR(12)
7050  PRINT
7060  PRINT QQ$(13);RR(13)
7070  PRINT
7080  PRINT QQ$(14);RR(14)
7090  PRINT
7100  PRINT QQ$(15);RR(15)
7110  PRINT
7180  PRINT QQ$(19);RR(19)
7183  IF S9 = 4 THEN  GOSUB 49007 : GOTO 8000
7185  GOSUB 41: GOSUB 49910
7190  GOSUB 40210
7193  IF  LEFT$ (RR$(2),1) = "Y" THEN 7260
7200 LQ = 11:LN = 2: GOSUB 40
7210  GOSUB 40000: IF ZN$ <  > "" THEN RR(11) = ZN
7220  GOSUB 40210
7230 LQ = 12:LN = 4: GOSUB 40
7240  GOSUB 40000: IF ZN$ <  > "" THEN RR(12) = ZN
7250  GOSUB 40210
7260 LQ = 13:LN = 6: GOSUB 40
7270  GOSUB 40000: IF ZN$ <  > "" THEN RR(13) = ZN
7280  GOSUB 40210
7290 LQ = 14:LN = 8: GOSUB 40
7300  GOSUB 40000: IF ZN$ <  > "" THEN RR(14) = ZN
7310  GOSUB 40210
7320 LQ = 15:LN = 10: GOSUB 40
7330  GOSUB 40000: IF ZN$ <  > "" THEN RR(15) = ZN
7340  GOSUB 40210
7345 GOTO 7440
7350 LQ = 16:LN = 12: GOSUB 40
7440 LQ = 19:LN = 12: GOSUB 40
7450  GOSUB 40000: IF ZN$ <  > "" THEN RR(19) = ZN
7460  REM
7470  GOSUB 40210: GOSUB 41
7480  GOSUB 51
7490  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR Q = QUIT ENTIRE ANALYSIS ";
7510  GOSUB 50
7520  GOSUB 40610
7540  IF Z$ = "Q" THEN 42900
7545  IF  LEFT$ (RR$(2),1) <  > "Y" THEN 7550: IF Z$ = "N" THEN 7290
7550  IF Z$ = "N" THEN 7190
7560  IF Z$ <  > "Y" THEN 7470
7570 GOSUB 48700
8000 A(1) = RR(1):A(6) = RR(2):A(2) = RR(3):A(3) = RR(4):A(4) = RR(5):A(5) = RR(6):A(15) = RR(7):A(14) = RR(8):R$(4) = RR$(1):R$(5) = RR$(2):A(8) = RR(11)
8010 A(9) = RR(12):A(11) = RR(13):A(12) = RR(14):A(13) = RR(15):R$(1) = RR$(3):R$(2) = RR$(4):R$(3) = RR$(5):D(1) = RR(19)
8020 REM
8030 RETURN
8999 REM ---------------------------------
9000 FLAG = 5 : GOSUB 6170
9005 A(1) = RR(1) : A(6) = RR(2) : GOSUB 445 : FLAG = 0
9010 PRINT
9015 PRINT "THE ""STANDARD"" FEED AND MISC. EXPENSE GUIDES PER HOG FED"
9020 PRINT "  TO ";A(1);"POUNDS ARE"
9025 PRINT "  BUSHELS CORN --";W4
9030 PRINT "  LBS. SBM SUPPLEMENT --";W5
9035 PRINT "    (NOTE FEED CONVERSION AT THIS WEIGHT IS ";W3;")"
9040 PRINT "  MINERALS AND ANTIBIOTICS -- $";A(11)
9045 PRINT "  MISC. ASSOCIATED CASH EXPENSE -- $";A(12)
9050 PRINT "  DESIRED RETURNS TO LABOR & FACILITIES -- $";A(13)
9100 PRINT
9110  PRINT QQ$(10);RR$(2)
9115 IF S9 = 4 THEN GOSUB 49007 : RETURN
9120 GOSUB 41 : GOSUB 49910
9125 GOSUB 40210
9130 LQ = 10:LN = 12: GOSUB 40
9140  GOSUB 40230: IF ZN$ <  > "" THEN RR$(2) = ZN$
9150  GOSUB 40210: GOSUB 41
9155  GOSUB 51
9160  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR Q = QUIT ENTIRE ANALYSIS ";
9165  GOSUB 50
9170  GOSUB 40610
9175  IF Z$ = "Q" THEN 42900
9180  IF Z$ = "N" THEN 9125
9185  IF Z$ < > "Y" THEN 9150
9200 RETURN
9210 REM ------------------------
9500 REM ------BEGIN INSTRUCTIONAL SUB -------------------
9510 GOSUB 38 : PRINT : PRINT
9520 LQ$(1)="FEEDPIGS ANALYZES THE PARTIAL BUDGETING QUESTION:  'GIVEN SUFFICENT LABOR"
9530 LQ$(2) = "& FACILITIES TO DO SO, THE PRICES OF FEEDERS, CORN & OTHER CASH EXPENSE,"
9540 LQ$(3) = "SHOULD I FEED HOGS? '"
9550 LQ$(4) ="   "
9560 LQ$(5) = "THE ANALYSIS CALCULATES A GROSS MARGIN FOR DOING SO AND COMPARES IT WITH A"
9570 LQ$(6) = "DESIRED RETURN TO LABOR AND FACILITIES (INCLUDING RISK AND MANAGEMENT).":LQ$(7) ="   "
9580 LQ$(8) = "A PLANNED VERSION WILL, LIKE PIGFIN, ALSO DEAL WITH THE APPROPRIATE MARKET"
9590 LQ$(9) = "WEIGHT QUESTION GIVEN THE RELATIONSHIP BETWEEN FEED CONVERSION AND WEIGHT"
9600 LQ$(10) = "OF THE HOG.  THIS VERSION DOES NOT." :LQ$(11) = "   "
9610 LQ$(12 )="    FEEDPIGS CONTAINS A DEFAULT STANDARD FEED AND MISCELLANEOUS"
9620 LQ$(13) ="    EXPENSE GUIDE PER HOG FED BUT THE USER MAY OVER-RIDE THEM."
9630 LQ$(14) = "  ":LQ$(15) = "    THERE ARE THREE TABLES INVOLVED:  THE FIRST IS A BUDGET FOR A"
9640 LQ$(16) ="    FEEDER PIG FED TO 220 POUNDS; TABLE 2 SHOWS BREAK-EVEN FEEDER"
9650 LQ$(17) ="    PIG PRICES PER HEAD (TO COVER ALL EXPENSES & DESIRED RETURN);"
9660 LQ$(18) ="    TABLE 3 IS THE BREAK-EVEN MARKET PRICES FOR A 220 POUND HOG"
9670 LQ$(19) ="    (TO COVER ALL EXPENSES & DESIRED RETURNS)."
9680 FOR I = 1 TO 19
9690 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 102
9700 PRINT LQ$(I)
9710 NEXT I
9720 GOSUB 49000:RETURN
9730 REM -----END INSTRUCTIONAL SUB ------------------
39450  REM   ---------------------------------------
39452 REM
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39456 REM
39457 REM
39458 REM
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39482 REM
39485 RETURN
39490  REM  ----------------------------------------
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39910 PRINT: PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES" :PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45565 PRINT : PRINT"DO NOT PANIC":PRINT "It is possible to recover from certain errors without losing any data.": PRINT "DO NOT EXIT FROM THIS PROGRAM.  Continue on for instructions."
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45675 LOCATE 7,5: PRINT"REMEDY/SUGGESTION:  ";RM$
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45677 IF FLAG = 23 THEN GOSUB 49000 : FLAG = 0 : GOTO 42900
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": GOSUB 46010
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 9510
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 9510
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46148 REM
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   10/22/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47205 GOSUB 39910
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   10/22/83          IBM-PC VERSION  !"
47350  PRINT SPC(20)"!            FEED PIGS                !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!  A STANDARD FEED AND MICELLANEOUS   !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"!EXPENSE GUIDE FOR HOGS FED TO 220 LBS!"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   10/22/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   10/22/83              (IBM - PC)  !"
48310  LPRINT "!             FEED PIGS?              !"
48320  LPRINT "!                                     !"
48330  LPRINT "!  A STANDARD FEED AND MISCELLANEOUS  !"
48340  LPRINT "!                                     !"
48350  LPRINT "!EXPENSE GUIDE FOR HOGS FED TO 220 LBS!"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50:GOSUB 49007:RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "Economics of Feeding Out a Lot of Feeder Pigs"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149  K2 = 19
49150  FOR I = 1 TO K2
49155 IF I = 16 OR I = 17 OR I = 18 THEN 49172
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ >19 GOTO 50200
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50170,50180,50190,50200,50210,50220,50230,50240,50250,50269,50279,50289,50290
50108  GOTO 50300
50110  LQ$ = "Expected weight after finishing - used to calculate interest & feed needs."
50119  GOTO 50300
50120  LQ$ = "40 lbs is typical though 30 to 75 lbs occur -used in feed & interest figures"
50129  GOTO 50300
50130  LQ$ = "Varies with the current market hog price & feeder pig supplies."
50139  GOTO 50300
50140  LQ$ = "Use outlook analysis & contract or futures prices to develop a target price."
50149  GOTO 50300
50150  LQ$ = "Feeding pigs is a way to price corn -when you fill the lot it's priced!"
50159  GOTO 50300
50160  LQ$ = "Laid-in price delivered to your facilities for the hog supplement you will use."
50169  GOTO 50300
50170  LQ$ = "Actual loan rate (annual) for loan or the alternative use % for your funds."
50179  GOTO 50300
50180  LQ$ = "Some pigs are die - 1 to 5% ? typical = 3% treated as a cash cost."
50189  GOTO 50300
50190  LQ$ = "Indicate `Yes" TO SEE THE DEFAULT DATA in this minn-aid."
50199  GOTO 50300
50200  LQ$ = "The MINN-AID contains default feed requirement data a "Y" responseshows it"
50209  GOTO 50300
50210  LQ$ = "Weather, facilities, & health etc. affect feed use (9 to 14 bushel!)."
50219  GOTO 50300
50220  LQ$ = "Weight, pasture, health etc. affect soymeal needs (60-120 lbs.)."
50229  GOTO 50300
50230  LQ$ = "Multiply amount / hog by the price."
50239  GOTO 50300
50240  LQ$ = "Electricitcy, use repairs, fuel, vet., etc. averaged / hog fed."
50249  GOTO 50300
50250  LQ$ = "Reservation value for risk, mgt., operator & family labor & facilities."
50259  GOTO 50300
50260  LQ$ = "`Y' = see table one results"
50269  GOTO 50300
50270  LQ$ = "`Y' = see the table of break-even pig & hog prices."
50279  GOTO 50300
50280  LQ$ = "`Y' = see the table of break-even feed & pig prices."
50289  GOTO 50300
50290  LQ$ = "What costs should the break-even tables cover ?   Don't forget the desired return question."
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN
53024 0!,2000,24,40,0.71,0.5
53025 REM ------------------------------------------

FEEDSILO.BAS

5 KEY OFF
7 CLS
10  PRINT : PRINT SPC(15)"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$": PRINT : PRINT
15  PRINT : PRINT SPC(13)"     FORAGE SILO INVENTORY EVALUATION": PRINT : PRINT
20  PRINT SPC(12)"        UNIVERSITY OF WISCONSIN-EXT."
22  PRINT : PRINT : PRINT SPC(14)"               WRITTEN BY": PRINT : PRINT
24  PRINT SPC(15)"        W.T. HOWARD, NOV. 1980"
30  PRINT : PRINT : PRINT
150  PRINT SPC(15)"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$": PRINT : PRINT
152  LOCATE 23,16: PRINT "* * PAUSE HIT ANY KEY TO CONTINUE * *":Z$ = INPUT$(1)
153 CLS
160  PRINT "ENTER THE DIAMETER OF SILO (FEET) ";: INPUT A
171  PRINT : PRINT "ENTER DEPTH OF SILAGE WHEN SILO IS FILLED ";:INPUT B
173  PRINT : PRINT "ENTER REMAINING DEPTH OF SILAGE "
174  PRINT " ( REMAIN. FEET CANNOT BE MORE THAN WHEN FULL) ";: INPUT C
175  PRINT : PRINT "ENTER NUMBER OF COWS ";:INPUT D
177  PRINT : PRINT "ENTER NUMBER OF HEIFERS ";:INPUT E
179  PRINT : PRINT "ENTER NUMBER OF DAYS IN FEEDING PERIOD ";:INPUT F
181  PRINT : PRINT "ENTER DESIRED DRY MATTER TO BE FED FROM SILO, IN LBS/COW/DAY ";:INPUT G
190  PRINT
230  PRINT
270 Z = A ^ 2
290 X = B ^ 1.43
310 Y = (B - C) ^ 1.43
330 YY = (X - Y) * 2.28 * Z
350 YY = YY / 2000
355  CLS  : PRINT "======================================"
358 NUMBER = YY: GOSUB 4000
390  PRINT
430  PRINT "TONS OF DRY MATTER IN THE SILO "; SPC( 21 -  LEN (NUMBER$));NUMBER$
450  PRINT
470  PRINT
570 CE = D + (E * 0.5)
665 NUMBER = CE: GOSUB 4000
670  PRINT "NUMBER OF COW EQUIVALENTS"; SPC( 27 -  LEN (NUMBER$));NUMBER$
690  PRINT
710  PRINT
730 FD = YY * 2000 / CE / F
750 K = FD
795 NUMBER = FD: GOSUB 4000
800  PRINT "LBS OF DRY MATTER AVAILABLE/COW/DAY "; SPC( 16 -  LEN (NUMBER$));NUMBER$
830  PRINT : PRINT
850 TF = G * CE * F / 2000
860 NUMBER = TF: GOSUB 4000
870  PRINT "TONS FED AT ";G;" LBS OF DRY MATTER/COW/DAY "; SPC( 9 -  LEN (NUMBER$));NUMBER$
890 TR = YY - TF
895  PRINT : PRINT :NUMBER = TR: GOSUB 4000
910  PRINT "TONS OF FORAGE DRY MATTER REMAINING "; SPC( 16 -  LEN (NUMBER$));NUMBER$
920  PRINT : PRINT "======================================"
930 LOCATE 20,1
950  PRINT "DO YOU WANT A SILAGE REMOVAL SCHEDULE (Y/N) ";:INPUT Z$
955 IF Z$ = "N" THEN 1990
960 IF Z$ = "Y" THEN 1010
970 IF Z$ < > "Y" OR Z$ < > "N" THEN 930
1010  CLS
1030 S1 = YY * 2000
1050  PRINT "ENTER # FEET PER LAYER REMOVED ";
1070  INPUT FI
1080  CLS
1090 S2 = (A ^ 2) * ((B ^ 1.43) - ((B - C) + FI) ^ 1.43) * 2.28
1110 S3 = S1 - S2
1130 S4 = S3 / (FI * 12)
1195 NUMBER = S4: GOSUB 4000
1200  PRINT "LBS OF DRY MATTER PER INCH IN THE NEXT ";FI;" FEET"; SPC( 15 -  LEN (NUMBER$));NUMBER$
1230  PRINT : PRINT
1250  PRINT "DO YOU WANT TO CHANGE THE DRY MATTER FED/COW/DAY ? "
1270  PRINT
1290  PRINT "YOU SET THE DRY MATTER FED/DAY AT ";G;" LBS PER COW"
1310  PRINT
1330  PRINT "ENTER NEW FEEDING RATE IN LBS OR 0 FOR NO CHANGE ";
1350  INPUT FC
1370  CLS
1380  PRINT : PRINT "************************************************"
1390  IF FC = 0 THEN  GOTO 1430
1410 G = FC
1430 DF = G * CE
1450 ID = DF / S4
1470  PRINT : PRINT
1490 NUMBER = ID: GOSUB 4000
1550  PRINT "INCHES PER DAY TO FEED ";G;" LBS PER COW"; SPC( 19 -  LEN (NUMBER$));NUMBER$
1570 DI = (FI * 12) / ID
1610  PRINT
1620 NUMBER = DI: GOSUB 4000
1630  PRINT "NUMBER OF DAYS TO FEED THE NEXT ";FI;" FEET"; SPC( 18 -  LEN (NUMBER$));NUMBER$
1650  PRINT
1670 DL = F - DI
1690 NUMBER = DL: GOSUB 4000
1750  PRINT "NUMBER OF DAYS LEFT IN THE FEEDING PERIOD"; SPC( 17 -  LEN (NUMBER$));NUMBER$
1760 F = F - DI
1770  PRINT
1780  PRINT : PRINT "************************************************"
1785  LOCATE 16,1
1790  PRINT "DO YOU WANT TO LOOK AT THE NEXT LAYER (Y/N) ";:INPUT C$
1800  IF C$ = "Y" THEN 1830
1810  IF C$ = "N" THEN 1970
1815  IF C <= FI THEN 1785
1820  IF C$ < > "Y" OR C$ < > "N" THEN 1785
1830 CLS
1870 C = C - FI
1890 Z = (A ^ 2) * ((B ^ 1.43) - ((B - C) + FI) ^ 1.43) * 2.28
1910 S1 = S2
1930 S2 = Z
1950  GOTO 1110
1970  PRINT "THE SILO IS EMPTY !!"
1990  PRINT
2010  PRINT "DO YOU WANT ANOTHER FEEDING SCHEDULE (Y/N) ";:INPUT F$
2020 IF F$ = "Y" THEN 7
2030 IF F$ = "N" THEN 4040
2040 IF F$ < > "Y" OR IF F$ < > "N" THEN 2010
2070  CLS : GOTO 150
2170  CLS
2190  REM
2210  END
2230  PRINT
2250  PRINT
2270  PRINT
4000 NUMBER =  INT ((NUMBER + 0.05) * 10) / 10
4010  IF NUMBER =  INT (NUMBER) THEN NUMBER$ =  STR$ (NUMBER) + ".0": RETURN
4020 NUMBER$ =  STR$ (NUMBER)
4030  RETURN
4040 PRINT : PRINT "WOULD YOU LIKE TO GO BACK TO THE MENU (Y/N) ";:INPUT I$
4050 IF I$ = "Y" THEN 5000
4060 IF I$ = "N" THEN 2210
4070 IF I$ < > "Y" OR I$ < > "N" THEN 4040

FEEDVALU.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
19 ON ERROR GOTO 45530
20 REM IBM PC VERSION OF SKELETON 01/01/83 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
24 KD$ ="A:" : REM DEFAULT DISK DRIVE
25  REM   K$ = DISK DATA FILE NAME
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70 DIM QQ$(6)
75 GOSUB 1520
80  GOSUB 47300
90 REM
100 GOSUB 46000
110 GOSUB 1620
200  REM
1000  REM   A MINN-AID DEVELOPMENT REFERENCES FM560 FEB 1980. PLUS EARL FULLER AND DALE NORDQUIST.
1130 REM
1190 V1 = ((1.1236 * S1) - (1.7836 * C1)) / 0.4055
1200 V2 = (C1 / 0.4536) - (0.1099 * V1)
1205 T2 = T1 * W1 / 100
1210 P2 = P1 * W1 / 100
1220 V3 = V2 * T2 / 100
1230 V4 = V1 * P2 / 100
1240 V5 = V3 + V4
1250 V6 = C1 / (0.81 * 56)
1260 V7 = V6 * T2
1270  GOSUB 38
1280  PRINT "VALUE OF ";: GOSUB 51: PRINT F$; : GOSUB 50: PRINT " WITH PROTEIN NOT VALUED  $ "; INT (V7 * 100) / 100;" PER BUSHEL"
1290  PRINT : PRINT "VALUE OF ";: GOSUB 51: PRINT F$; : GOSUB 50: PRINT " WITH PROTEIN ALSO VALUED $ "; INT (V5 * 100) / 100;" PER BUSHEL"
1292  PRINT : PRINT
1350  PRINT "WITH CORN (81% TDN AND 8.9 % CP) AT     $ ";C1;" PER BUSHEL"
1355  PRINT : PRINT
1360  PRINT "AND SOYBEAN MEAL (72% TDN & 44% CP) AT  $";S1;" PER CWT"
1363  PRINT
1365  PRINT : GOSUB 51: PRINT F$;: GOSUB 50: PRINT "(";T1;"% TDN AND ";P1;"% CP) IS WORTH  $"; INT (V5 * 100) / 100;" / ";W1;"LB"
1370  PRINT "(ASSUMING PROTEIN IS VALUED)"
1380  PRINT : PRINT : PRINT "IF PROTEIN IS NOT VALUED, ";
1385  GOSUB 51
1390  PRINT F$;: GOSUB 50: PRINT " IS WORTH  $"; INT (V7 * 100) / 100;" / ";W1;"LB"
1400  PRINT : PRINT : GOSUB 49010
1410 GOTO 100
1500  REM
1505  IF C1 < 0 OR C1 > 5 THEN  GOSUB 38
1507  IF C1 < 0 OR C1 > 5 THEN 1130
1510  REM  TO AVOID RE-DIMENSIONING ERRORS, DIM DECLARATIONS SHOULD BE MOVED TO THE 'TOP' OF THE PROGRAM
1520 I = 1  :CH = 53
1530  REM  DEFAULT DATA VALUES FOR THIS INPUT SECTION
1540 C1 =2.75 : QQ$(1) = "PRICE IN $/BU OF 86% D.M. CORN.."
1550 S1 =12 : QQ$(2) = "PRICE IN $/CWT OF 89% D.M. MEAL."
1560 F$ = "WHEAT" : QQ$(3) = "NAME OF FEED STUFF.............. "
1570 T1 =80.5 : QQ$(4) = "PERCENT TDN AS FED.............."
1580 P1 =14 : QQ$(5) = "PERCENT CRUDE PROTEIN AS FED...."
1590 W1 =60 : QQ$(6) = "POUNDS PER UNIT OF FEED........."
1600   RETURN
1610  REM ----------------------------
1620  GOSUB 38
1630  PRINT SPC(20); : GOSUB 51 : PRINT "<RETURN>=USE LAST KEY-IN TO QUESTION"
1640  GOSUB 50
1650  GOSUB 39
1660  PRINT
1670  PRINT SPC(20);QQ$(1);C1
1680  PRINT
1690  PRINT SPC(20);QQ$(2);S1
1700  PRINT
1710  PRINT SPC(20);QQ$(3);F$
1720  PRINT
1730  PRINT SPC(20);QQ$(4);T1
1740  PRINT
1750  PRINT SPC(20);QQ$(5);P1
1760  PRINT
1770  PRINT SPC(20);QQ$(6);W1
1775 IF S9 = 4 THEN GOSUB 49000 : GOTO 1190
1780  GOSUB 41: GOSUB 49910
1790 LQ = 1:LN = 2: GOSUB 40
1800  GOSUB 40000: IF ZN$ <  > "" THEN C1 = ZN
1810 LO = 0:HI = 5
1820  IF C1 < LO OR C1 > HI THEN  GOSUB 40150: GOSUB 40
1830  GOSUB 40210
1840 LQ = 2:LN = 4: GOSUB 40
1850  GOSUB 40000: IF ZN$ <  > "" THEN S1 = ZN
1860  GOSUB 40210
1870 LQ = 3:LN = 6: GOSUB 40
1880  GOSUB 40230: IF ZN$ <  > "" THEN F$ = ZN$
1890  GOSUB 40210
1900 LQ = 4:LN = 8: GOSUB 40
1910  GOSUB 40000: IF ZN$ <  > "" THEN T1 = ZN
1920 LO = 0:HI = 100
1930  IF T1 < LO OR T1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1900
1940  GOSUB 40210
1950 LQ = 5:LN = 10: GOSUB 40
1960  GOSUB 40000: IF ZN$ <  > "" THEN P1 = ZN
1970 LO = 0:HI = 100
1980  IF P1 < LO OR P1 > HI THEN  GOSUB 40150: GOSUB 40: GOTO 1950
1990  GOSUB 40210
2000 LQ = 6:LN = 12: GOSUB 40
2010  GOSUB 40000: IF ZN$ <  > "" THEN W1 = ZN
2020  REM
2030  GOSUB 40210:GOSUB 41
2040  GOSUB 51
2050  PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N);";
2060  PRINT "(OR <CNTL-Q> = QUIT ENTIRE ANALYSIS) ";
2070  GOSUB 50
2080 GOSUB 40610
2090 IF Z$ = QE$ THEN 42900
2100 IF Z$ = "N" THEN 1790
2110 IF Z$ <> "Y" THEN 2030
2115 GOSUB 48700
2120 RETURN
2130  REM  END THIS INPUT SECTION
2140 RETURN
2150 REM -------------------------------------------------
3000 REM ----------------------------------------------------------------------
3010 LQ$(1) = "  The MINN-AID FEEDVALUE estimates a feedstuff's in use economic value"
3015 LQ$(2) = "as an alternative to the purchase of corn grain and or soybean meal."
3020 LQ$(3) = "It assumes that animal performance will not be effected given the total ration."
3030 LQ$(4) = "Corn is assumed to contain 8.9% crude protein and 81% T.D.N."
3040 LQ$(5) = "Soybean meal contains 44% crude protein and 72% total digestable nutrients."
3050 LQ$(6) = "Both are handled on an as-fed-basis.   Calculations consider protein short"
3060 LQ$(7) = "and sufficient protein from other source situations.  In use value of a feed"
3070 LQ$(8) = "may or may not be reflected in the observed market price on any day."
3080 GOSUB 38
3090 FOR I = 1 TO 8
3100 PRINT : PRINT LQ$(I)
3110 IF PR$ = "Y" THEN LPRINT :LPRINT LQ$(I)
3120 NEXT I
3140 GOSUB 49007
3150 RETURN
3160 REM ---------------------------------------
11410  PRINT "WANT ANOTHER FEED STUFF (Y OR N)";
38900 REM
38999 REM
39400  REM   SUBS TO TOGGLE PRINTER
39410  IF PR$ <  > "Y" THEN  RETURN
39420  LOCATE 20,20 :PRINT "TURN PRINTER ON & PRESS ANY KEY ";: Z$ = INPUT$(1) : IF Z$ < > "" THEN RETURN
39425  GOTO 39420
39440 PRINT "THE PRINTER IS NOT BEING USED ?" : RETURN
39450  REM   ---------------------------------------
39452 REM
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39456 REM
39457 REM
39458 REM
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39482 REM
39485 RETURN
39490  REM  ----------------------------------------
39500  REM   PROCEDURE SUB TO TEST PRINTER USE
39510  PRINT "WILL YOU USE A PRINTER (Y OR N) ";
39520  INPUT PR$: IF PR$ = ES$ THEN 38900
39530 PR$ =  LEFT$ (PR$,1)
39540  RETURN
39550  REM  ----------------------------------------
39560  REM   END PROCEDURE TO USE ? PRINTER
39570  REM
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40400  REM   PROCEDURE TO PRINT LENGTH OF DATA PROMPT (REQUIRED OR MAXIMUM
40405  REM   PROPER USE REQUIRES POST GENBASIC CODING OF WL & FL'S
40410  PRINT  LEFT$ (SQ$,WL);
40420  IF FL > 0 THEN  PRINT "."; LEFT$ (SQ$,FL);
40430 CX = CH:CY = CV + LN: GOSUB 42
40440  RETURN
40450  REM   END PROCEDURAL SUB
40460  REM  ----------------------------------------
40500  REM    PROCEDURE TO VERIFY THE PROPER LENGTH OF CODED INPUT (ENTRY) * *
40510  IF  LEN (ZN$) = WL THEN  RETURN
40520  PRINT  CHR$ (7); CHR$ (7);
40530  GOSUB 41
40535  GOSUB 51
40537  PRINT "ENTRY IS CODED & MUST BE ";WL;" DIGITS LONG..RE-ENTER THE PROPER VALUE..."
40540  GOSUB 50
40541 CX = CH:CY = CV
40542  GOSUB 42: GOSUB 43
40550  GOSUB 40400
40560  GOSUB 40100
40570  GOTO 40010
40580  REM   END PROCEDURE
40590  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
41000 REM PROCEDURE TO COPY OVER A SEQUENTIAL FILE BEFORE ADDING DATA TO IT.
41010 ON ERROR GOTO 41900
41020 OPEN"I",#1,K$
41030 REM IF FILE EXISTS ,WRITE IT TI K1$
41040 OPEN "O",#2,K1$
41050 IF EOF(1) THEN 41090
41060 LINE INPUT #1,Z$
41070 PRINT #2,Z$
41080 GOTO 41050
41090 CLOSE#1
41100 REM WHEN TO KILL K$..BACKUP?
41110 RETURN
41200 REM ADD DATA TO #2
41300 REM CLOSE#2
41400 REM NAME K1$ AS K$ ?? HERE OR BEFORE CLOSE??
41900 REM CAPTURE NO FILE FOUND & START ONE AT THAT POINT
41910 IF ERR = 53 AND ERL =20 THEN OPEN"0",#2,K1$ : RESUME 41120
41920 ON ERROR GOTO 0
41930 REM----END FIE COPY PROCEDURE
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN GOTO 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": Z$ = INPUT$(1)
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 3010
46115 GOSUB 49100
46120 GOSUB 48020
46121  GOSUB 38
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 3010
46139  IF S9 > 3 THEN 46150
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   10/22/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   10/22/83              IBM - PC    !"
47350  PRINT SPC(20)"!            FEED VALUE               !"
47360  PRINT SPC(20);"!                                     !"
47370  PRINT SPC(20);"! COMPARES CRUDE PROTEIN & TDN VALUES !"
47380  PRINT SPC(20);"!                                     !"
47390  PRINT SPC(20);"!  OF CORN & S.B.MEAL (AS FED BASIS)  !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   10/22/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   10/22/83              (IBM - PC)  !"
48310  LPRINT "!             FEED VALUE              !"
48320  LPRINT "!                                     !"
48330  LPRINT "! COMPARES CRUDE PROTEIN & TDN VALUES !"
48340  LPRINT "!                                     !"
48350  LPRINT "!  OF CORN & S.B.MEAL (AS FED BASIS)  !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48750 REM*** CONVERTS INPUT OF LOWER CASE TO UPPER CASE
48755 IF K2$ = "" THEN RETURN
48760 I% = ASC(K2$)
48770 IF I% > 96 AND I% < 123 THEN K2$ = CHR$(I%-32)
48780 RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50 : GOSUB 49007 : RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "?????? PUT A TITLE HERE"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149  REM   K2 = NO OF QUESTIONS
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 6 THEN 50200
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160
50108  GOTO 50300
50110  LQ$ = "The laid-in if purchased, the net market price if sold for corn as an alternative feed."
50119  GOTO 50300
50120  LQ$ = "The laid-in price per cwt. of 44% protein soybean meal as an alternative feed."
50129  GOTO 50300
50130  LQ$ = "Such as wheat, barley, corn silage, ear corn, or mixed hay."
50139  GOTO 50300
50140  LQ$ = "The as fed total digestible nutrient content as a percent."
50149  GOTO 50300
50150  LQ$ = "The as fed crude nutrient content as a percent"
50159  GOTO 50300
50160  LQ$ = "The pounds of feedstuff per unit of feed as the price will bequoted."
50169  GOTO 50300
50170 IF PQ$ = "Y" THEN LPRINT LQ$
50200  REM    ON LO-10 GOTO 50210 ETC. FOR MORE HELPS
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN

FILES459.TXT

--------------------------------------------------------------------------
Disk No 459   Assorted agricultural programs                         v1.1
--------------------------------------------------------------------------
 
   MINNAIDS 4/11/84 U. OF MINNESOTA
 
This seems to be a useful collection of decision aids for Farm Management.
Type "RUN" and then type the RETURN key to start this set of tools.
Basica is required.
 
ACRSCALC BAS  Analysis of Federal Depreciation Computations (1983 law)
AUTOEXEC BAT  Automatic instructions to read this file
BESTCROP BAS  Price & Yield Analysis of Crop Choices (Equal-margin)
DATECALC BAS  Computes Future (Gestation) Dates & Calendars
DRYSTORE BAS  Analysis of Harvest and Storage Cost & Alternatives
FARMBID  BAS  Determines the Maximum Bid Price for Land or a Farm.
FEEDPIGS BAS  Should I Feed Out a Batch of Feeder Pigs ?
FEEDSILO BAS  Calculates Likely Dairy Feed in a Silo Given Feed Rate
FEEDVALU BAS  Given Corn & SBM Values, What's a Feed Worth ?
MENU     BAS  Menu program for BASIC pgms on this disk
PEARSON  BAS  Balances 1 Ration Nutrient from 2 Feed Sources
READ     BAT  Batch file to provide instructions for SCROLLCK.COM
README   DOC  Author supplied documentation file
RUN      BAT  Batch file requests date, loads Basica & starts MINN - AIDS
SCROLLCK COM  Scroll lock - control with shift keys (U/M - no info on it)
SDIR     COM  Sorted directory with other good features
SDIR     DOC  Documentation for SDIR, outlining options and features
SOWINDEX BAS  Determines a Sow Index, Relative to the Group
STEERBID BAS  Calculates Equivalent FOB prices for Fat Steers at Farm
TIMEC    COM  Some kind of time display program ???  (U/M - no info on it)
ULOGO    BAS  University of Minnesota Logo - START HERE - or at MENU
USERDOCS BAS  Explains How to Make Hardcopy Documentation of MINNAIDS
 
PC-SIG
1030D E Duane Avenue
Sunnyvale Ca. 94086
(408) 730-9291
(c) Copyright 1987 PC-SIG
8 DATA "ACRSCALC.BAS","Analysis of Federal Depreciation Computations"
10 DATA "BESTCROP.BAS","Price & Yield Analysis of Crop Choices (Equal-margin)"
12 DATA "DATECALC.BAS","Computes Future (Gestation) Dates & Calendars"
14 DATA "DRYSTORE.BAS","Analysis of Harvest and Storage Cost & Alternatives"
16 DATA "FARMBID .BAS","Determines the Maximum Bid Price for Land or a Farm."
24 DATA "FEEDPIGS.BAS","Should I Feed Out a Batch of Feeder Pigs ?"
26 DATA "FEEDSILO.BAS","Calculates Likely Dairy Feed in a Silo Given Feed Rate"
28 DATA "FEEDVALU.BAS","Given Corn & SBM Values, What's a Feed Worth ?"
34 DATA "NECGAIN .BAS","Calculates Expected Feedlot Gain for Cattle"
36 DATA "PEARSON .BAS","Balances 1 Ration Nutrient from 2 Feed Sources"
38 DATA "SOWINDEX.BAS","Determines a Sow Index, Relative to the Group; Files them."
40 DATA "STEERBID.BAS","Calculates Equivalent FOB prices for Fat Steers at Farm"
80 DATA "USERDOCS.BAS","Explains How to Make Hardcopy Documentation of MINNAIDS"
95 DATA "END OF FILES","END OF FILES"
100 DIM A$(30),B$(30)
105 CLS
110 KD$ = "A:"
112 ON ERROR GOTO 45530
115 GOSUB 48710 : GOSUB 48600
120 PRINT "03/11/1984                                                 MICRO-SOFT BASIC"
125 PRINT  TAB( 30)"M I N N - A I D S"
130 PRINT
135 PRINT  TAB( 28)"COMPUTER DECISION AIDS"
140 PRINT  TAB( 37)"for"
145 PRINT  TAB( 31)"Farm Management"
150 PRINT
155 PRINT  TAB( 20)"Minnesota Agricultural Experiment Station"
160 PRINT  TAB( 25)"Projects 14-026 and 14-036"
165 PRINT
170 PRINT  TAB( 36)"also"
175 PRINT  TAB( 19)"The Minnesota Agricultural Extension Service"
180 PRINT  TAB( 19)"USDA, the State and the counties cooperating"
185 PRINT
190 PRINT  TAB( 33)"through the"
195 PRINT  TAB( 28)"University of Minnesota,"
200 PRINT  TAB( 17)"Department of Agricultural and Applied Economics"
205 PRINT
210 PRINT  TAB( 34)"249 COB"
215 PRINT  TAB( 25)"Institute of Agriculture"
220 PRINT  TAB( 25)"Saint Paul Minnesota 55108"
225 PRINT
230  GOSUB 49000
300 I = 1
310 READ A$(I),B$(I) : IF A$(I) = "END OF FILES" THEN 330
320 I = I + 1 : GOTO 310
330 K = I-1
340 CLS : PRINT"Run    File              MINN-AIDS   Computer Decision Aids"
350 PRINT"No.    Name         Select and Run one to see more detail about what it does"
360 PRINT
370 FOR I = 1 TO K
380 PRINT USING "##  \          \ - \                                                         \";I;A$(I);B$(I)
385 IF K < 9 THEN PRINT
390 NEXT I
400 PRINT
410 PRINT"Type the `Run No.' & then Press <RETURN> to get & run any selection"
420 PRINT"Alternatively `Q ' will exit to BASIC, & `F' will display the file list"
430 PRINT"Enter a `Run No.' 1 through ";K;" or a `F' or a `Q' & a <RETURN> ";
440 CV = CSRLIN
450 INPUT Z$
460 I = VAL(Z$)
462 IF I < 1 THEN 480 ELSE 464
464 IF I > K THEN 580 ELSE 466
466 CLS :LOCATE 10,20 : COLOR 0,7 : PRINT"RUNNING ";A$(I); :COLOR 7,0
470 CHAIN A$(I)
480 GOSUB 40630
485 IF Z$ <> "F" OR Z$ = "?" THEN GOTO 500
490 LOCATE 23,1,0 : FILES KD$+"*.*" : GOSUB 49000: GOTO 340
500 IF Z$ <> "Q" THEN GOTO 510  ELSE 590
510 REM
580 PRINT"SORRY I DON'T UNDERSTAND PLEASE RE-ENTER " : LOCATE CV,65,0
585 GOTO 450
590 PRINT : PRINT"Returning to BASIC as instructed  " TIME$ "  " DATE$ : END
595 GOTO 450
610 KD$ = "a:"
620 PRINT"What Disk Drive has the MINN-AID file of interest ? (A or B etc...<RETURN>=A";
630  GOSUB 39 : GOSUB 40610 : IF Z$>="A" AND Z$<="C" THEN 650
640 Z$=KD$ : GOTO 660
650 Z$ = Z$+":"
660 REM ABOVE LINES NOT USED HERE
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40625 IF Z$ =" " THEN Z$ ="N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
43002 KD$="MENU.BAS"
43003 CHAIN KD$
45530 REM ERROR TRAPPING ROUTINE ------------------------------
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": Z$ = INPUT$(1)
45684 RESUME 105
45690                                                                           RUN
45900 REM -----------------------------------------------
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
49000 PRINT : PRINT TAB(20)"Pause..Press Any Key to Start.."; : Z$ = INPUT$(1) : PRINT : RETURN

PEARSON.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF PEARSON SQUARE 03/18/84 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
70  DIM Y$(19),QQ$(11),Y(14),LQ$(12)
80  GOSUB 1410
90  GOSUB 47300
100 GOSUB 46000
110 REM
170 REM
175  GOSUB 1670
180 GOSUB 3500
300  REM    ALL INPUT IS AS DECIMAL FRACTIONS?
310 O0 = O0 * 0.01
320 O1 = O1 * 0.01
330 O2 = O2 * 0.01
340 O3 = O3 * 0.01
350 O4 = O4 * 0.01
360 O5 = O5 * 0.01
370 O6 = O6 * 0.01
380 O7 = O7 * 0.01
390 O8 = O8 * 0.01
400 O9 = O9 * 0.01
410 I0 = I0 * 0.01
420 I1 = I1 * 0.01
430 I2 = I2 * 0.01
440 I3 = I3 * 0.01
450 A0 = O0 - O7 * O8
460 A1 = 1 - O7 - I1
470 A2 = A0 / A1
480  IF O1 >  = A2 GOTO 510
490  IF A2 < O4 GOTO 580
500  GOTO 520
510  IF A2 >  = O4 GOTO 580
520 GOSUB 38: PRINT BL$;BL$;
522 LOCATE 2,30 :COLOR 16,7:PRINT " MIX IS NOT FEASIBLE "
524 GOSUB 50 : PRINT : PRINT "    INGREDIENT PERCENTS MUST BOUND THE REQUIRED RATION INGREDIENT PERCENT"
526 LOCATE 6,34: COLOR 25,0
530 PRINT"THEY DO NOT" : GOSUB 50  : PRINT
540 ZD = O1*100:GOSUB 45000 :PRINT "    THE PERCENT OF THE NUTRIENT, ";N$;" CONTAINED IN ";F$; " IS "; ZD$;"%."
550 ZD = O4*100:GOSUB 45000 :PRINT "    THE PERCENT OF THE NUTRIENT, ";N$;" CONTAINED IN ";G$; " IS "; ZD$;"%."
560 ZD = A2*100:GOSUB 45000 :PRINT "    WHILE THE SPECIFIED MIX PERCENTAGE OF ";N$;" IS ";ZD$;"%."
570 PRINT:PRINT:GOTO 940
580 A3 =  ABS (A2 - O1)
590 A4 =  ABS (A2 - O4)
600 A5 = A3 + A4
610 I6 = A3 / A5 * A1
620 B = I6 * 100
630 I7 = A4 / A5 * A1
640 A = I7 * 100
650 I8 = I7 * O2 + I6 * O5 + I1 * I2 + O7 * O9
660 C = I8 * 100
670 I9 = I7 * O3 + I6 * O6 + I1 * I3 + O7 * I0
680 D = I9 * 100
682 REM PRINT "O0;01;O2;O3;O4;O5;O6;O7;O8;O9;I0;I1;I2;I3;A0;A1;A2;A3;A4;A4;I6;B;I7;A;IB;C;I9;D"
684 REM PRINT O0;1;O2;O3;O4;O5;O6;O7;O8;O9;I0;I1;I2;I3;A0;A1;A2;A3;A4;A4;I6;B;I7;A;IB;C;I9;D
685 PRINT : PRINT :PRINT" WHAT UNIT OF WEIGHT IS TO BE USED IN MIXING A BATCH :"
687 PRINT
690  PRINT "1 = TOTAL BATCH WEIGHTS IS IN POUNDS"
691  PRINT "2 = WEIGHT IS MEASURED IN CWTS..WHICH ";
695  INPUT K1
710 K$ = "CWT."
720  IF K1 = 2 GOTO 731
730 K$ = "POUNDS"
731 PRINT
732  PRINT " WHAT IS THE SIZE OF BATCH TO BE MIXED AS MEASURED IN ";K$;" ";
735  INPUT W1: PRINT
740  PRINT : PRINT : GOSUB 38
742  PRINT : PRINT SPC(11)"NECESSARY BATCH AMOUNTS FOR A "; :GOSUB 51: PRINT O0 * 100;"% ";N$;" "; :GOSUB 50: PRINT" MIX"
746  PRINT SPC(20)"BATCH SIZE OF "; :GOSUB 51: PRINT W1;K$;" ";  :GOSUB 50
748  PRINT  : PRINT
750  PRINT"   INGREDIENT              PROPORTIONS       BATCH AMTS."
752  PRINT"   ----------              -----------       -----------"
754  PRINT
760  PRINT USING "\                   \   ####.##  PERCENT";F$;A;
762  PRINT  USING "    ####.##  \   \";A*0.01* W1
778  PRINT
780  PRINT USING "\                   \   ####.##  PERCENT";G$;B;
782  PRINT  USING "    ####.##  \   \";B*0.01* W1
798  PRINT : IF H$ = "" THEN 820
800  PRINT USING "\                   \   ####.##  PERCENT";H$;O7 * 100;
802  PRINT  USING "    ####.##  \   \";O7 * W1
818  PRINT
820  PRINT USING "\                   \   ####.##  PERCENT";I$;I1 * 100;
822  PRINT  USING "    ####.##  \   \";I1 * W1
840   PRINT :  PRINT
850  PRINT USING "        PERCENT CALCIUM IN MIX...  ####.##";C
870  PRINT USING "        PERCENT PHOSPHROUS IN MIX  ####.##";D
873  PRINT
875  PRINT : GOSUB 49007
877 IF PR$ ="Y" THEN 8740
895  PRINT
900  PRINT "ANOTHER MIX ? 0 = NO, 1 = YES, 2 = NEW NUTRIENT LEVEL ";
910  INPUT K1
920  IF K1 = 1 THEN  GOSUB 38: S9 = 5 :IF K1 = 1 THEN 100
930  IF K1 <  > 2 GOTO 42900
935  PRINT
940  PRINT "ENTER NEW NUTRIENT PCT LEVEL FOR THE COMPLETED MIX ";
950  INPUT O0
960 O0 = O0 * 0.01
970  GOTO 450
1410 Y$(1) = "PROTEIN"
1415 Y$(2) = "12.00"
1420 Y$(3) = "SHELLED CORN"
1425 Y$(4) = "8.9"
1430 Y$(5) = ".01"
1435 Y$(6) = ".25"
1440 Y$(7) = "SOYBEAN MEAL"
1445 Y$(8) = "44.0"
1450 Y$(9) = ".25"
1455 Y$(10) = ".6"
1460 Y$(11) = "ALFALFA MEAL"
1465 Y$(12) = "17.0"
1470 Y$(13) = "1.3"
1475 Y$(14) = ".23"
1480 Y$(15) = "5"
1485 Y$(16) = "DICALCIUM PHOS"
1490 Y$(17) = "4.25"
1493 Y$(18) = "22.7"
1497 Y$(19) = "9.25"
1510  REM  TO AVOID RE-DIMENSIONING ERRORS, DIM DECLARATIONS SHOULD BE MOVED TO THE 'TOP' OF THE PROGRAM
1520 K2 = 11:CH = 65
1540  REM  DEFAULT DATA VALUES FOR THIS INPUT SECTION
1550 QQ$(1) = "ENTER NAME OF THE NUTRIENT TO BALANCED IN THE RATION........... "
1560 QQ$(2) = "ENTER THE REQUIRED PERCENT OF THE NUTRIENT IN THE RATION....(%) "
1570 QQ$(3) = "NAME OF FEEDSTUFF.............................................. "
1580 QQ$(4) = "ENTER PERCENT OF THE NUTRIENT IN THIS FEEDSTUFF.............(%) "
1590 QQ$(5) = "ENTER PERCENT OF CALCIUM IN THIS FEEDSTUFF..................(%) "
1600 QQ$(6) = "ENTER PERCENT OF PHOSPHOROUS IN THIS FEEDSTUFF..............(%) "
1610 QQ$(7) = "ENTER PERCENT OF THE 3RD FEEDSTUFF TO BE PUT IN THE RATION..(%) "
1620 QQ$(8) = "ENTER THE NAME OF THE MINERAL SOURCE IN THE RATION............. "
1630 QQ$(9) = "ENTER PERCENT OF THE MINERAL SOURCE ITSELF IN THE RATION....(%) "
1640 QQ$(10)= "ENTER PERCENT OF CALCIUM IN THE MINERAL SOURCE..............(%) "
1643 QQ$(11)= "ENTER PERCENT OF PHOSPHOROUS IN THE MINERAL SOURCE..........(%) "
1650 RETURN
1660 REM -------------END SETUP & BEGIN DATA ENTRY SUBS ------------
1670  GOSUB 38
1680  LOCATE ,25: GOSUB 51 :PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
1690  GOSUB 50
1700  GOSUB 39
1710 YY = 1:H = 0:J = 1
1715  REM
1720 H = H + 1: IF H = 3 THEN J = 11
1725  IF H = 2 THEN J = 7
1727  FOR I = YY TO 6
1728 IF H = 3 AND I = 4 THEN GOSUB 51 : PRINT " DO NOT WANT THIRD FEED? ENTER '0' OR 'NONE' ": GOSUB 50 : GOTO 1740
1730  PRINT
1740  IF I = 3 THEN  GOSUB 50010: GOTO 1760
1750  PRINT QQ$(I);Y$(J)
1755 IF H = 3 AND I = 6 THEN PRINT : PRINT QQ$(7);Y$(15)
1760 J = J + 1
1770  NEXT I
1772 IF FLAG = 5 THEN RETURN
1775 IF S9 = 4 THEN GOSUB 49000:IF H < > 3 THEN YY = 3 : GOTO 1715
1776 IF S9 = 4 THEN 1800
1780  GOTO 1910
1800  FOR I = 8 TO 11
1810 J = I + 8
1820  PRINT
1825 IF Y$(11) = "0" AND I = 7 THEN PRINT : GOTO 1840
1826 IF Y$(11) = "NONE" AND I = 7 THEN PRINT : GOTO 1840
1830  PRINT QQ$(I);Y$(J)
1840  NEXT I
1845 IF S9 = 4 THEN GOSUB 49000:GOTO 3000
1850  GOSUB 41: GOSUB 49910:GOSUB 40210
1860  RETURN
1910  GOSUB 41: GOSUB 49910:GOSUB 40210
1911 J = 1
1915  IF H > 1 THEN 1977
1918 GOSUB 40210
1920 LQ = 1:LN = 2: GOSUB 40
1930  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
1940  GOSUB 40210
1945 J = J + 1
1950 LQ = 2:LN = 4: GOSUB 40
1960  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
1970  GOSUB 40210
1975 J = J + 1
1977  IF H = 3 THEN LQ = 10 :J = 11 : IF Y$(11) = "0" OR Y$(11)= "NONE" THEN FLAG = 5
1978  IF H = 2 THEN LQ = 6 : J = 7
1979 GOSUB 40210
1980 LQ = LQ + 1:LN = 6: GOSUB 40
1990  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
1992 IF H = 3 THEN DDD = 3 :IF Y$(11) = "0" OR Y$(11) = "NONE" THEN LOCATE ,,0: FOR I = 1 TO 10 : PRINT SPC(79) : NEXT I : LOCATE ,,1 : GOTO 2084
1995 IF FLAG = 5 THEN YY = 4 : J = 12 :GOSUB 1727
1997 FLAG = 0
2000  GOSUB 40210
2005 J = J + 1
2010 LQ = LQ + 1:LN = 8: GOSUB 40
2020  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
2030  GOSUB 40210
2035 J = J + 1
2040 LQ = LQ + 1:LN = 10: GOSUB 40
2050  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
2060  GOSUB 40210
2065 J = J + 1
2070 LQ = LQ + 1:LN = 12: GOSUB 40
2080  GOSUB 40230: IF ZN$ <  > "" THEN Y$(J) = ZN$
2081 J = J + 1
2082 IF H = 3 THEN GOSUB 2100
2084  GOSUB 6000
2085  IF H = 3 THEN 2095
2086 CX = 1:CY = CY - 2: GOSUB 42: GOSUB 45
2087 YY = 3:CX = 1:CY = 6: GOSUB 42: LOCATE ,,0
2088 FOR I = 1 TO 10 : PRINT SPC(79) : NEXT I : CX = 1 : CY = 6 : GOSUB 42 : LOCATE ,,1 : GOTO 1715
2095  GOSUB 2370
2097  J = 8 :GOSUB 1800
2098  GOTO 2125
2100 LQ = 15:LN =14: GOSUB 40
2110  GOSUB 40230: IF ZN$ <  > "" THEN Y$(15) = ZN$
2120  GOSUB 40210:RETURN
2125 GOSUB 40210
2130 LQ = 16:LN = 2: GOSUB 40
2140  GOSUB 40230: IF ZN$ <  > "" THEN Y$(16) = ZN$
2150  GOSUB 40210
2160 LQ = 17:LN = 4: GOSUB 40
2170  GOSUB 40230: IF ZN$ <  > "" THEN Y$(17) = ZN$
2180  GOSUB 40210
2190 LQ = 18:LN = 6: GOSUB 40
2200  GOSUB 40230: IF ZN$ <  > "" THEN Y$(18) = ZN$
2205  GOSUB 40210
2207 LQ = 19:LN = 8: GOSUB 40
2210  GOSUB 40230: IF ZN$ <  > "" THEN Y$(19) = ZN$
2215  GOTO 2460
2370  GOSUB 38
2380  LOCATE ,25: GOSUB 51:PRINT "<RETURN> = ACCEPT THE DEFAULT VALUE(S) "
2390  GOSUB 50
2400  GOSUB 39
2405  RETURN
2460  REM
2470  GOSUB 40210:CX = 1:CY = CV + LN + 2: GOSUB 42
2480  GOSUB 51
2490  GOSUB 41:PRINT:PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR Q = QUIT ENTIRE ANALYSIS ";
2510  GOSUB 50
2520 GOSUB 40610
2540  IF Z$ = "Q" THEN 42900
2550  IF Z$ = "N" THEN 2098
2560  IF Z$ < > "Y" THEN 2470
2570 GOSUB 48700
3000 N$ = Y$(1):F$ = Y$(3):G$ = Y$(7):H$ = Y$(11):I$ = Y$(16)
3010 IF Y$(11) = "0" OR Y$(11) = "NONE" THEN H$ = "" : FOR I = 12 TO 15 : Y$(I) = "0" : NEXT I
3100 J = 0
3110  FOR I = 1 TO 19
3120  IF I = 1 OR I = 3 OR I = 7 OR I = 11 OR I = 16 THEN 3200
3130 J = J + 1
3140 Y(J) =  VAL (Y$(I))
3200  NEXT I
3350 RETURN
3499 REM ---------------------CHANGE VARIABLE NAMES  SUB ----------
3500 O0 = Y(1):O1 = Y(2):O2 = Y(3):O3 = Y(4):O4 = Y(5):O5 = Y(6):O6 = Y(7)
3510 O7 = Y(11):O8 = Y(8):O9 = Y(9):I0 = Y(10):I1 = Y(12):I2 = Y(13):I3 = Y(14)
3550 RETURN
3560 REM ------------------------------------------------------------
4000 REM -----begin explaination screen
4010  GOSUB 38
4020  LQ$(1) ="PEARSON SQUARE uses a simple ratio calculation procedure"
4025  LQ$(2) ="to determine how much of two feed stuffs is required to"
4030  LQ$(3) ="satisfy a user specified nutrient requirement level."
4035  LQ$(4) ="The user may select any nutrient of interest such as"
4040  LQ$(5) ="crude protein or ENE or total digestable nutrients."
4042  LQ$(6) =" "
4045  LQ$(7) ="This particular MINN-AID also allows the user to include"
4050  LQ$(8) ="a third feed stuff at a specified level as part of the"
4055  LQ$(9) ="ration.   It also requires data on the mineral content of"
4060  LQ$(10) ="all the feed stuffs plus a added mineral supplement.   It"
4065  LQ$(11) ="uses these data to calculate the calcium & phosphorous"
4070  LQ$(12) ="content of the resulting mixed ration."
4075  FOR I = 1 TO 12: IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 4090
4080  PRINT SPC(15);LQ$(I) : IF I <> 6 THEN PRINT
4090  NEXT I : GOSUB 49000 : RETURN
4095 REM ---end explaination sub --------------------
6000  REM
6010  GOSUB 40210:CX = 1:CY = CV + LN + 2: GOSUB 42
6020  GOSUB 51
6030  GOSUB 41:PRINT:PRINT "DATA OK?..WANT TO GO AHEAD (Y OR N) OR Q = QUIT ENTIRE ANALYIS ";
6050  GOSUB 50
6060 GOSUB 40610
6080  IF Z$ = "Q" THEN 42900
6085  IF H = 1 THEN 6090
6087  IF Z$ = "N" THEN 1977
6090  IF Z$ = "N" THEN 1918
7000  IF Z$ < > "Y" THEN 6010
7010  REM   END THIS INPUT SECTION
7020  RETURN
8700 REM-------------PRINTED RESULTS SUB START -------------
8740 LPRINT :LPRINT
8742  LPRINT : LPRINT SPC(11)"NECESSARY BATCH AMOUNTS FOR A "; O0 * 100;"% ";N$;"  MIX"
8746 LPRINT SPC(20)"BATCH SIZE OF "; W1;K$
8748 LPRINT  :LPRINT
8750 LPRINT"   INGREDIENT              PROPORTIONS       BATCH AMTS."
8752 LPRINT"   ----------              -----------       -----------"
8754 LPRINT
8760 LPRINT USING "\                   \   ####.##  PERCENT";F$;A;
8762 LPRINT  USING "    ####.##  \   \";A*0.01* W1
8778 LPRINT
8780 LPRINT USING "\                   \   ####.##  PERCENT";G$;B;
8782 LPRINT  USING "    ####.##  \   \";B*0.01* W1
8798 LPRINT : IF H$ = "" THEN 8820
8800 LPRINT USING "\                   \   ####.##  PERCENT";H$;O7 * 100;
8802 LPRINT  USING "    ####.##  \   \";O7 * W1
8818 LPRINT
8820 LPRINT USING "\                   \   ####.##  PERCENT";I$;I1 * 100;
8822 LPRINT  USING "    ####.##  \   \";I1 * W1
8840 LPRINT : LPRINT
8850 LPRINT USING "        PERCENT CALCIUM IN MIX...  ####.##";C
8860 LPRINT "            PCT PHOSPHROUS IN MIX  ####.##";D
8870 LPRINT USING "        PERCENT PHOSPHROUS IN MIX  ####.##";D
8880 RETURN
8890 REM ------------END PRINTED RESULTS SUB ---------------
10000  GOTO 300
33485  PRINT  SPC( 5 -  LEN (ZD$));ZD$
38900 REM
39450  REM   ---------------------------------------
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39485 RETURN
39490  REM  ----------------------------------------
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45565 PRINT : PRINT"DO NOT PANIC":PRINT "It is possible to recover from certain errors without losing any data.": PRINT "DO NOT EXIT FROM THIS PROGRAM.  Continue on for instructions."
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45675 LOCATE 7,5: PRINT"REMEDY/SUGGESTION:  ";RM$
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45677 IF FLAG = 23 THEN GOSUB 49000 : FLAG = 0 : GOTO 42900
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": ZZ$ = INPUT$(1)
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 4000
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 4000
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   10/22/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   10/22/83               IBM - PC   !"
47350  PRINT SPC(20)"!            PEARSON SQUARE           !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!  CALCULATES NECESSARY BATCH AMOUNTS !"
47380  PRINT SPC(20)"!    FOR A FIXED AMOUNT OF PROTEIN    !"
47390  PRINT SPC(20)"!   ALSO CALCULATES NEW NUTRIENT %'S  !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   10/22/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   10/22/83              (IBM - PC)  !"
48310  LPRINT "!           PEARSON SQUARE            !"
48320  LPRINT "!                                     !"
48330  LPRINT "!  CALCULATES NECESSARY BATCH AMOUNTS !"
48340  LPRINT "!    FOR A FIXED AMOUNT OF PROTEIN    !"
48350  LPRINT "!   ALSO CALCULATES NEW NUTRIENT %'S  !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50:GOSUB 49007:RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "Pearson Square Feed Mix Ratio Calculations for a Given Nutrient Level"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149 K2 = 11
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50000  PRINT K;" ";
50010  IF H = 3 THEN RR$ = "RD ": GOSUB 50090: GOTO 50060
50020 IF H = 2 THEN RR$ = "ND " : GOSUB 50090:GOTO 50060
50030 RR$ = "ST ": GOSUB 50090
50060  IF PQ$ <  > "Y" THEN 50080
50070  PRINT "          ";Y$(K)
50073  IF H = 1 THEN  RETURN
50075  RETURN
50080  PRINT Y$(J)
50085  RETURN
50090  PRINT "ENTER THE NAME OF THE "; : GOSUB 51 : PRINT H; RR$; :GOSUB 50 : PRINT " FEEDSTUFF TO BE USED.............. ";
50095  RETURN
50100  REM     LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41: GOSUB 45
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 19 GOTO 50300
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50150,50170,50140,50150,50150,50210,50140,50150,50150,50250,50260,50267,50150,50150
50110  LQ$ = "Name of the nutrient of (critical?) interest such as protein, ENE or TDN"
50119  GOTO 50300
50120  LQ$ = "Based upon nutritional considerations, the percentage the ration should have."
50129  GOTO 50300
50130  LQ$ = "The 1st feed stuff to be varied but used in the ration mix."
50139  GOTO 50300
50140  LQ$ = "The percent nutrient content on `AS IS' or `Dry Matter Basis' BE consistent"
50149  GOTO 50300
50150  LQ$ = "Again be consistent between feed stuffs in using either `AS IS' or `DMB'"
50159  GOTO 50300
50170  LQ$ = "The 2nd feed stuff to be varied but used in the ration mix."
50179  GOTO 50300
50180  LQ$ = "The percent nutrient content on `AS IS' or `Dry Matter Basis' BE consistent"
50189  GOTO 50300
50210  LQ$ = "The 3rd. feedstuff is not part of the ratio; it's use level is user given."
50219  GOTO 50300
50250  LQ$ = "The 3rd. feed stuff's level is user set & is not part of the ratio calculation"
50259  GOTO 50300
50260  LQ$ = "Simply describe the mineral supplement to be put in the mix."
50265  GOTO 50300
50267  LQ$ = "The mineral source will be in the mix at the percentage level you specify."
50269  GOTO 50300
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN
53024 0!,2000,24,40,0.71,0.5
53025 REM ------------------------------------------

README.DOC

		MINNAIDS 4/11/84 U. OF MINNESOTA
MENU     BAS     6016  Menu program for BASIC pgms on this disk
ACRSCALC BAS    30976  Analysis of Federal Depreciation Computations
BESTCROP BAS    24448  Price & Yield Analysis of Crop Choices (Equal-margin)
DRYSTORE BAS    32000  Analysis of Harvest and Storage Cost & Alternatives
DATECALC BAS     9600  Computes Future (Gestation) Dates & Calendars
FEEDSILO BAS     3968  Calculates Likely Dairy Feed in a Silo Given Feed Rate
PEARSON  BAS    27008  Balances 1 Ration Nutrient from 2 Feed Sources
STEERBID BAS     7808  Calculates Equivalent FOB prices for Fat Steers at Farm
FEEDPIGS BAS    32512  Should I Feed Out a Batch of Feeder Pigs ?
AUTOEXEC BAT      128  Automatic instructions to read this file
USERDOCS BAS     3712  Explains How to Make Hardcopy Documentation of MINNAIDS
ULOGO    BAS     1251  University of Minnesota Logo - START HERE - or at MENU
TIMEC    COM     1183  ???  No info at (U/M)
SDIR     COM     1072  Sorted directory with other good features
SDIR     DOC           SDIR feature documentation
FEEDVALU BAS    21632  Given Corn & SBM Values, What's a Feed Worth ?
FARMBID  BAS    29568  Determines the Maximum Bid Price for Land or a Farm.
SOWINDEX BAS    28672  Computes a Sow Index, Relative to the Group; files them
READ     BAT      256  Batch file to provide instructions for SCROLLCK.COM
SCROLLCK COM      512  Scroll lock - control with shift keys - no info @ (U/M)
README   DOC     1536  This file
CROLLCK.COM
SCROLLCK COM      512  Sc

SOWINDEX.BAS

5 CLEAR ,&HFFFF :GOSUB 48510
20 REM IBM PC VERSION OF SKELETON 01/01/83 E.I.F. AGR. ECON., AGR. EXP. STATION & AGR. EXT. SERVICE UNIV/MINN.
22 REM GOSUB 48700 : REM KEYOFF-RETURN ?????
24 KD$ ="A:" : REM DEFAULT DISK DRIVE
25  REM   K$ = DISK DATA FILE NAME
27  REM   N1 - N2 - M1 - M2 - I - T ARE SOMETIMES USED TO COUNT LINES ETC.
28  REM   K2 - K3 USED TO COUNT NO OF INPUT OR OUTPUT QUESTIONS OR LINES
30 REM WL = 6: REM   DEFAULT WHOLE NO. PART OF DATA ENTRY (CHANGE INTERNALLY AS REQUIRED)
31  REM   PR$ = (Y OR N) ;PRINTED RESULTS?
32  REM   PQ$ = (Y OR N) ;LIST QUESTIONAIRE?
33  REM    Z$ = (Y OR N) ; SWITCH FOR GENERAL USE
34  REM   ZN - ZN$ - ZD - ZD$ - CH$ ARE TEMPORARY INPUT & OUTPUT DATA VARIABLES (REUSED).
35  ON ERROR GOTO 45530
36  GOTO 54
37  REM  NEXT 20-30 LINES CONTAIN CURSOR CONTROL COMMANDS TO BE CHANGED FOR OTHER DIALECTS
38  CLS : RETURN
39 CV =  CSRLIN-1 : RETURN : REM   LOCATE CURSOR VERTICALLY
40 CX = CH : CY = CV + LN : GOTO 42
41 CX = 1: CY=ZM
42  LOCATE CY,CX,1,1,10:RETURN
43 CX=POS(0):LOCATE CY,CX,0:PRINT SPC(79-CX); : LOCATE ,CX,1:RETURN : REM   CLEAR TO END OF LINE
44 CH =  POS(0):CV =  CSRLIN + 1: RETURN : REM LOCATE CURSOR  POSITION
45 GOSUB 40210 : REM CLEAR REST OF SCREEN (BELOW LINE ZM ANYWAY)
46  IF CV < 1 THEN CV = 1: REM   BOUND CURSOR MOVEMENT TO SCREEN AREA
47  IF CV > ZM THEN CV = ZM
48 CX = CV + 1: LOCATE CX,,1: GOSUB 43: RETURN
49  LOCATE ,CH + 1 +  LEN (ZN$): GOSUB 43: RETURN
50 COLOR 7,0 : RETURN : REM SET NORMAL SCREEN
51 COLOR 0,7 : RETURN : REM SET INVERSE SCREEN
52  REM  50-52 TO TRIGGER REVERSE SCREEN BRIGHTNESS
53  REM   ER$ - EL - EC = ERROR PROCEDURE VALUES AT 45540-50
54 ZM = 22: REM   ERROR MESSAGE ON SCREEN LOCATION.
55 ZS = 2: REM    START TO SCROLL IF NEAR ERROR MESSAGE SPACE.
56  REM   LQ = INPUT QUESTION NUMBER FOR HELPS PROCEDURE AT 50100
57  REM   IDO = 1,2 - A DOUBLE SPACE SWITCH
58 ES$ =  CHR$(27) : REM   ESCAPE TO RETURN TO MAIN MENU AT 100?
59 QE$ =  CHR$(17): QU$ = "QUIT":REM    CNTL Q = Q(UIT)-RETURN
60 BL$ = CHR$(7)
61 BS$ =  CHR$ (8): REM    LEFT ARROW
62 CR$ = CHR$(13)
63 NAK$ =  CHR$ (21): REM    RIGHT ARROW
64  REM    ABOVE 4 CHARACTERS FOR SUB AT 40300
65 PR$ = "N":PP$="OFF":CC$="N"
66 REM  GOSUB 38:LOCATE,,0,1,10: REM GOSUB 48700 : REM TURNS KEY OFF @ 22 ????
67  DIM ID$(100),Y$(100),DA(100),NS(100),WD(100),NB(100),WX(100),NX(100)
68  DIM QQ$(6),LQ$(26)
70  REM    END DIMENSION SPACE
75 GOSUB 1000
80  GOSUB 47300
90 REM
100  GOSUB 46000
105  IF S9 = 4 THEN 200
110  IF S9 = 5 THEN  GOSUB 38: PRINT : PRINT "DO YOU WANT TO ADD NEW SOWS TO AN EXISTING FILE (Y/N) ";
120  GOSUB 40610 : IF Z$ = "Y" THEN S9 = 8: GOTO 5162
130  IF Z$ <  > "N" THEN 120
200  GOSUB 1125
400  IF S9 = 5 THEN  GOSUB 2000
410  GOSUB 38: PRINT : PRINT "WANT TO STORE THIS DATA TO FILE ";
420  GOSUB 40610 :IF  LEFT$ (Z$,1) = "Y" THEN  GOSUB 5020
430  GOSUB 38: GOTO 100
490 REM ------------------BEGIN INITIAL SCREEN SUB -------------------
500  GOSUB 38
505 LQ$(1) = "                    SOW PRODUCTIVITY INDEX"
510 LQ$(2) = " "
520 LQ$(3) = "  This program evaluates sow productivity on an individual and"
530 LQ$(4) = "herd comparison basis.  It adjusts for gilt versus sows, num-"
540 LQ$(5) = "ber born alive, number nursed and pig gain (milking ability)."
550 LQ$(6) = "It offers an comparative ranking of the group." : LQ$(7) = " "
575  LQ$(8) =  "(1) 21 DAY WEIGHT IS = WT * (27/AGE+6)"
580  LQ$(9) =  "(2) IF LESS THAN 10 PIGS ARE NURSED THEN:"
585  LQ$(10) =  "   A) FOR GILTS 9 POUNDS ARE ADDED"
590  LQ$(11) = "   B) FOR SOWS 10 POUNDS ARE ADDED"
595  LQ$(12) =  "   C) TO THE 21 DAY WEIGHT FOR EACH PIG UNDER 10 NURSED."
600  LQ$(13) = "(3) 17 POUNDS ARE ADDED TO THE 21 DAY WT. TO EQUIVALENT GILTS TO SOW INDEX BASE."
610  LQ$(14) = "(4) 1.3 PIGS ARE ALSO ADDED TO GILTS TO ADJUST TO THE SOW INDEX BASE,"
615  LQ$(15) = "(5) FOR THE NUMBER FARROWED ALIVE (NFA)."
620  LQ$(16) = "(6) THE SOW PRODUCTIVITY INDEX IS THEN,"
625  LQ$(17) = "(7) SPI =(6.5*NFA)+21 DAY LITTER WEIGHT."
627  LQ$(18) = " " : LQ$(19) = "USE OF MENU OPTION 4 ALLOWS YOU TO:"
628  LQ$(20) = "  1. run an example set of sow data,"
629  LQ$(21) = "  2. view data previously stored on a file, or"
630  LQ$(22) = "  3. make changes in the previously stored data including deleting sows from a file entirely."
631  LQ$(23) = " " : LQ$(24) = "USE OF MENU OPTION 5 ALLOWS YOU TO:"
632  LQ$(25)= "  1. create entirely new files of sows, or"
633  LQ$(26) = "  2. insert new sows into an existing data file."
640 FOR I = 1 TO 26
642 IF PQ$ = "Y" THEN LPRINT LQ$(I) : GOTO 648
644 IF PR$ = "Y" THEN  LPRINT LQ$(I) ELSE PRINT LQ$(I)
646 IF I = 17 THEN GOSUB 49007 : GOSUB 38
648 NEXT I
650 IF PQ$ = "Y" THEN RETURN
652 GOSUB 49007 : RETURN
660 REM --------------------END INITIAL SCREEN SUB -------------------
1000 K2 = 6:CH = 42
1005  IF S9 = 4 THEN 1050
1010  GOSUB 38:CH = 42
1020  GOSUB 51
1030  PRINT "TYPE A  0 AT ITEM 1 TO QUIT DATA ENTRY"
1035  PRINT
1037  PRINT "ENTER DATA ON SPECIFIC SOW OR GILT"
1040  GOSUB 50: IF S9 = 4 THEN  RETURN
1050 QQ$(1) = "SOW ID NUMBER OR NAME (UP TO 10 CHRS.).. "
1060 QQ$(2) = "PARITY;(ENTER G = GILT & S = SOW)....... "
1070 QQ$(3) = "AGE IN DAYS OF LITTER AT WEIGHING......."
1080 QQ$(4) = "NUMBER OF PIGS NURSED TO WEIGH DATE....."
1090 QQ$(5) = "WEIGHT OF ENTIRE LITTER ON WEIGH DATE..."
1100 QQ$(6) = "NUMBER OF PIGS BORN ALIVE..............."
1105 RETURN
1110 REM ------------END INPUT SETUP ---BEGIN INPUT SUB --------------
1115  IF S9 = 4 THEN 6000
1125  PRINT
1127  GOSUB 39:CV = CV + 1
1130  PRINT "SOW/GILT POSITION IN THE FILE...........  ";I
1134  PRINT
1140  PRINT QQ$(1);"       "
1150  PRINT
1160  PRINT QQ$(2);"       "
1170  PRINT
1180  PRINT QQ$(3);"       "
1190  PRINT
1200  PRINT QQ$(4);"       "
1210  PRINT
1220  PRINT QQ$(5);"       "
1230  PRINT
1240  PRINT QQ$(6);"       "
1245  GOSUB 49910
1250  GOSUB 40210
1260 LQ = 1:LN = 2:CX = CH:CY = CV + LN: GOSUB 42
1270  GOSUB 40230: IF ZN$ <  > "" THEN ID$(I) = ZN$
1274  IF ID$(I) = "" GOTO 1260
1280  IF ID$(I) = "0" THEN T = I - 1: GOTO 1600
1290  GOSUB 40210
1300 LQ = 2:LN = 4:CX = CH:CY = CV + LN: GOSUB 42
1310  GOSUB 40230: IF ZN$ <  > "" THEN Y$(I) = ZN$
1312  IF Y$(I) = "G" OR Y$(I) = "S" THEN 1320
1313  GOSUB 51
1314  GOSUB 40210: PRINT  CHR$ (7);: PRINT "YOU MUST RESPOND WITH A 'G' OR A 'S',RE-DO";: GOSUB 50
1315  GOTO 1300
1320  GOSUB 40210
1330 LQ = 3:LN = 6:CX = CH:CY = CV + LN: GOSUB 42
1340  GOSUB 40000: IF ZN$ <  > "" THEN DA(I) = ZN
1350 LO = 14:HI = 29
1360  IF DA(I) < LO OR DA(I) > HI THEN  GOSUB 40150:CX = CH:CY = CV + LN: GOSUB 42: GOTO 1330
1370  GOSUB 40210
1380 LQ = 4:LN = 8:CX = CH:CY = CV + LN: GOSUB 42
1390  GOSUB 40000: IF ZN$ <  > "" THEN NS(I) = ZN
1400 LO = 1:HI = 16:CX = CH:CY = CV + LN: GOSUB 42
1410  IF NS(I) < LO OR NS(I) > HI THEN  GOSUB 40150:CX = CH:CY = CV + LN: GOSUB 42: GOTO 1380
1420  GOSUB 40210
1430 LQ = 5:LN = 10:CX = CH:CY = CV + LN: GOSUB 42
1440  GOSUB 40000: IF ZN$ <  > "" THEN WD(I) = ZN
1450 LO = 20:HI = 500
1460  IF WD(I) < LO OR WD(I) > HI THEN  GOSUB 40150:CX = CH:CY = CV + LN: GOSUB 42: GOTO 1430
1470  GOSUB 40210
1480 LQ = 6:LN = 12:CX = CH:CY = CV + LN: GOSUB 42
1490  GOSUB 40000: IF ZN$ <  > "" THEN NB(I) = ZN
1500 LO = NS(I):HI = 20
1510  IF NB(I) < LO OR NB(I) > HI THEN  GOSUB 40150:CX = CH:CY = CV + LN: GOSUB 42: GOTO 1480
1530 GOSUB 40210 : GOSUB 41
1542  GOSUB 51
1544  PRINT "DATA OK?..(Y OR N), CNTL-E = QUIT DATA ENTRY, ";
1547  IF S9 = 6 THEN 1551
1549  PRINT "CNTL-Q = RETURN TO MENU ";: GOTO 1555
1550  PRINT "DATA OK?..(Y OR N), CNTL-E = QUIT DATA ENTRY, ";
1551  PRINT "CNTL-Q = RETURN TO MENU ";
1552  IF S9 = 6 THEN  PRINT "CNTL-D = DELETE SOW FROM FILE ";
1555  GOSUB 50
1560  GOSUB 40610
1562  IF Z$ =  CHR$ (4) THEN D = I + 1: GOSUB 8000:I = D - 2: GOTO 1574
1565  IF  Z$ = QE$ THEN 38900
1567  IF  Z$ =  CHR$ (5) THEN T = I: RETURN
1570  IF  Z$ = "N" THEN GOSUB 40210 : GOTO 1260
1573  IF  Z$ <  > "Y" THEN 1530
1574  IF S9 = 6 THEN  RETURN
1575 T = I
1580  IF I = 100 GOTO 1574
1590 I = I + 1: GOSUB 40210 :CH = 1 : CV = CV-1 : LN = 0 : GOSUB 40 : GOTO 1130
1600  RETURN
1610  REM
2000 AB = 0:AN = 0:AA = 0:AI = 0
2005 JP = 0
2890  IF T < 1 THEN GOSUB 38 : GOTO 100
2900  FOR I = 1 TO T
2905  GOSUB 4000
2910 AB = AB + NX(I)
2920 AN = AN + NS(I)
2930 AA = AA + WX(I)
2940 AI = AI + SX(I)
2946 ID$(I) =  LEFT$ (ID$(I),7)
2950  NEXT I
2960 AB = AB / T
2970 AN = AN / T
2980 AA = AA / T
2990 AI = AI / T
3000 REM -----------------------------------------------------------
3010  REM   BEGIN  TABLE STUBS SECTION
3020 SB$(1) = "21 DAY ADJUSTED ENTIRE LITTER WEIGHT LB."
3030 SB$(2) = "SOW'S PRODUCTIVITY INDEX NUMBER........."
3040 SB$(3) = "SOW'S ID NUMBER OR NAME................."
3050 SB$(4) = "NUMBER OF SOWS IN THIS GROUP............"
3055 C(4) = T
3060 SB$(5) = "AVERAGE NUMBER OF PIGS BORN ALIVE......."
3065 C(5) = AB
3070 SB$(6) = "AVERAGE 21 DAY ADJUSTED LITTER WEIGHT..."
3075 C(6) = AA
3080 SB$(7) = "AVERAGE NUMBER NURSED TO WEIGH DATE....."
3085 C(7) = AN
3090 SB$(8) = "AVERAGE PRODUCTIVITY NUMBER THIS GROUP.."
3095 C(8) = AI
3097 GOSUB 48700
3100  REM   START  TABLE COL. HEADERS
3110  GOSUB 38
3155  PRINT "    CALCULATED SOW PRODUCTIVITY INDEXES"
3160  PRINT
3165  PRINT ".. FOR THE AVERAGE OF THIS SOW GROUP.."
3170  PRINT
3172 IF PR$ <> "Y" THEN 3195
3175 LPRINT "    CALCULATED SOW PRODUCTIVITY INDEXES"
3180 LPRINT
3185  LPRINT ".. FOR THE AVERAGE OF THIS SOW GROUP.."
3190  LPRINT
3195 M1 = 4:M2 = 8
3200  FOR I = M1 TO M2
3220  PRINT SB$(I);
3230 PRINT USING "#####.##"; C(I)
3240 PRINT
3245 IF PR$ <> "Y" THEN 3280
3250 LPRINT SB$(I);
3260 LPRINT USING "#####.##"; C(I)
3270 LPRINT
3280  NEXT I
3282  REM IF JP > 0 THEN 3285
3285  IF JP > 0 THEN  RETURN
3290  REM   BEGIN EACH SOW LIST
3300 M1 = 1:M2 = 2
3302  PRINT : PRINT "..FOR EACH SOW IN THE GROUP...."
3303  IF PR$ <  > "Y" THEN  PRINT : GOSUB 49000: GOSUB 38
3304  PRINT
3305  PRINT : PRINT "..FOR EACH SOW IN THE GROUP...."
3306  IF PR$ <  > "Y" THEN  3310
3308 LPRINT : LPRINT "..FOR EACH SOW IN THE GROUP...."
3309 LPRINT
3310  FOR J = 1 TO T
3320 C(1) = WD(J)
3330 C(2) = SX(J)
3335  PRINT "SOW'S NUMERIC POSITION IN THE FILE....    ";J
3337  PRINT
3340  PRINT SB$(3);"  ";ID$(J)
3350  GOSUB 3190
3355  REM
3356  PRINT : PRINT
3357  GOSUB 49007: GOSUB 38
3360  IF PR$ <  > "Y" THEN  3390
3365 LPRINT "SOW'S NUMERIC POSITION IN THE FILE....    ";J
3370 LPRINT
3375 LPRINT SB$(3);"  ";ID$(J)
3380 LPRINT
3390  NEXT J
3400  REM IF PR$ = "Y" THEN  GOSUB 39430:PR$ = "N"
3500  RETURN
3999  REM   PROCEDURE FOR CALCULATING INDIVIDUAL SOW INDEXES (BEGIN)
4000 WX(I) = WD(I) * (27 / (DA(I) + 6))
4008  IF Y$(I) = "S" THEN 4060
4010 WX(I) = WX(I) + 17
4020  IF NS(I) > 9 THEN 4040
4030 WX(I) = WX(I) + 9 * NS(I)
4040 NX(I) = NB(I) + 1.3
4050  GOTO 4080
4060  IF NS(I) > 9 THEN 4075
4070 WX(I) = WX(I) + 10 * NS(I)
4075 NX(I) = NB(I)
4080 SX(I) = (6.5 * NX(I)) + WX(I)
4090  RETURN : REM -------- END INDEX CALC PROCEDURE ------
4100 REM -----------------------------------------------------------
5000  REM  SAVE INPUT DATA TO SEQUENTIAL FILE CM$ = ","
5010  PRINT
5015 EP = 5
5020  PRINT "FILE NAME TO SAVE DATA UNDER <CR> = SKIP IT ";
5030  INPUT K$
5040  IF  LEFT$ (K$,1) = " " THEN  RETURN
5050  GOSUB 39000
5060  ON ERROR  GOTO 45500
5070  GOSUB 39217
5075  REM  APPEND K$
5080  REM  WRITE NEW DATA TO FILE;
5085 Z$ =  STR$ (T)
5086  PRINT#1,Z$
5090  FOR I = 1 TO T
5100 Z$ = ID$(I) + CM$ + Y$(I) + CM$ +  STR$ (DA(I)) + CM$ +  STR$ (NS(I))
5105 Z$ = Z$ + CM$ +  STR$ (WD(I)) + CM$ +  STR$ (NB(I)) + CM$ +  STR$ (SX(I))
5110  PRINT#1,Z$
5120  NEXT I
5130  GOSUB 39310
5133 EP = 0
5134 IF EC > 0 THEN GOTO 42900
5135  PRINT
5140  PRINT "WANT TO ANALYZE ANY OF THE PREVIOUSLY STORED DATA Y OR N ";
5150  GOSUB 40610
5160  IF Z$ <  > "Y" THEN  RETURN
5161 S9 = 6
5162  PRINT
5165  PRINT "NAME OF FILE TO ANALYZE ";: INPUT K$
5166  PRINT
5167  GOSUB 39000
5168  PRINT
5170 EP = 3
5195 I1 = 1
5220  GOSUB 39100
5225  REM  POSITIONK$,I1
5226  INPUT#1,T
5230  FOR I = I1 TO T
5240  INPUT#1,ID$(I),Y$(I),DA(I),NS(I),WD(I),NB(I),SX(I)
5245  NEXT I
5246 EP = 0
5247  GOSUB 39310
5248  IF S9 = 8 THEN I = T + 1:S9 = 5: GOSUB 1010: GOTO 400
5250  IF EC = 5 THEN 1050
5251 GOSUB 38 : PRINT : PRINT"FILE "; : GOSUB 51 : PRINT K$; : GOSUB 50 : PRINT " CONTAINS DATA ON "; : GOSUB 51 : PRINT T; : GOSUB 50 : PRINT " SOWS." : PRINT
5253  PRINT : PRINT "SOW TO START ANALYSIS WITH...": PRINT "(ENTER NUMERIC POSITION OF SOW IN FILE) ";: INPUT BS1
5254  PRINT : PRINT "SOW TO END ANALYSIS WITH..": PRINT "(ENTER NUMERIC POSITION OF SOW IN FILE) ";: INPUT ES2
5255 IF ES2 > T THEN PRINT CHR$(7) : PRINT : GOSUB 51 : PRINT " THERE ARE ONLY ";T;" SOWS IN THIS FILE.  PLEASE TRY AGAIN." : GOSUB 50 : GOTO 5254
5265  GOSUB 6010
5270  RETURN
5280 REM ----------------------------------------------------------
6000  GOSUB 7000: IF Z = 2 THEN 410
6001  GOSUB 38: GOSUB 1010
6002 ID$(1) = "GH34":ID$(2) = "GH56":ID$(3) = "QW324":Y$(1) = "S":Y$(2) = "G":Y$(3) = "S":DA(1) = 16:DA(2) = 22:DA(3) = 21:NS(1) = 10 : NS(2) = 8
6003 NS(3) = 9:WD(1) = 250:WD(2) = 210:WD(3) = 230:NB(1) = 11:NB(2) = 10:NB(3) = 9
6005 I = 1: GOTO 6050
6010  FOR I = BS1 TO ES2
6015  GOSUB 38
6020  GOSUB 51
6030  PRINT "TYPE A  0 AT ITEM 1 TO QUIT DATA ENTRY"
6035  PRINT
6037  PRINT "ENTER DATA ON SPECIFIC SOW OR GILT"
6040  GOSUB 50
6050  PRINT
6055  GOSUB 39:CV = CV + 1
6060  PRINT "SOW/GILT POSITION IN THE FILE...........  ";I
6065  PRINT
6070  PRINT QQ$(1);"  ";ID$(I)
6075  PRINT
6080  PRINT QQ$(2);"  ";Y$(I)
6085  PRINT
6090  PRINT QQ$(3);"  ";DA(I)
6095  PRINT
6100  PRINT QQ$(4);"  ";NS(I)
6105  PRINT
6110  PRINT QQ$(5);"  ";WD(I)
6115  PRINT
6120  PRINT QQ$(6);"  ";NB(I)
6121  IF S9 = 6 THEN  PRINT :ZD = SX(I): GOSUB 45000: PRINT SB$(2);"  ";ZD$:CH = 44:JP = 0: GOSUB 1245: IF I = ES2 THEN S9 = 5 : GOTO 400
6125  IF S9 = 6 THEN  NEXT I:S9 = 5: GOTO 400
6130  PRINT : PRINT
6200  GOSUB 49000:I = I + 1: IF I = 4 THEN T = 3: GOTO 2000
6210  GOTO 6015
6220 REM ----------------------------------------------------------
7000  GOSUB 38
7010  PRINT "DO YOU WISH TO RUN THE EXAMPLE DATA OR  DO YOU WANT TO ANALYZE PREVIOUSLY STOREDDATA (1 = EXAMPLE, 2 = STORED DATA) ";
7020  INPUT Z
7030  IF Z = 2 THEN  GOSUB 5161: RETURN
7040  IF Z = 1 THEN  RETURN
7050  GOTO 7020
7060 REM ----------------------------------------------------------
8000  REM
8010  FOR I = D TO T
8020 ID$(I - 1) = ID$(I):Y$(I - 1) = Y$(I):DA(I - 1) = DA(I):NS(I - 1) = NS(I):WD(I - 1) = WD(I):NB(I - 1) = NB(I):SX(I - 1) = SX(I)
8030  NEXT I
8040 T = T - 1:ES2 = ES2 - 1
8050  RETURN
8100 GOSUB 38 : LOCATE 2,1 : PRINT "WHEN THE ERROR OCCURRED WERE YOU TRYING TO SAVE DATA TO A DISK (Y OR N)";:INPUT J$
8110 IF J$ < > "y" AND J$ < > "Y" THEN 8119
8115 GOTO 5010
8119 GOTO 5135
8200 REM ----------------------------------------------------------
39000 REM PROCEDURAL SUB TO DEFINE DISK DRIVES
39005 PRINT
39010 PRINT " THE DEFAULT DISK DRIVE IS CURRENTLY: ";KD$
39030 PRINT : PRINT "DO YOU WANT TO CHANGE THE DEFAULT DRIVE (Y OR N)";
39040 INPUT Z$ : GOSUB 48790
39050 IF Z$ = "N" THEN RETURN
39060 PRINT : PRINT "DEFAULT DRIVE SHOULD BE (A OR B)";
39070 INPUT KD$ : K2$ = KD$ :GOSUB 48750:KD$ = K2$
39075 IF KD$ < > "A" AND KD$ < > "B" THEN PRINT CHR$(7) : GOTO 39060
39080 RETURN
39090 REM**********
39100 REM SUB TO OPEN DISK FILE FOR INPUT TO PROGRAM
39110 ON ERROR GOTO 45500
39120 FILE$ = KD$ + ":" + K$ + ".DAT"
39130 OPEN "I",1,FILE$
39140 RETURN
39150 REM*********
39200 REM SUB TO OPEN DISK FILE FOR OUTPUT FROM PROGRAM
39217 ON ERROR GOTO 45500
39220 FILE$ = KD$ + ":" + K$ + ".DAT"
39230 OPEN "O",1,FILE$
39240 RETURN
39250 REM*********
39300 REM SUB TO CLOSE FILES
39310 CLOSE
39320 RETURN
39330 REM********
39450  REM   ---------------------------------------
39452 REM
39455 REM      REVERSE PRINTER SWITCH PROCEDURE
39456 REM
39457 REM
39458 REM
39460 IF PR$ ="Y" THEN PR$ = "N" :PP$ = "OFF" : GOTO 39470
39465 PR$ = "Y" : PP$ = "ON"
39470 PRINT TAB(26); : GOSUB 51
39480 PRINT "(PRINTING OPTION IS NOW SWITCHED ";PP$;")" : GOSUB 50
39482 REM
39485 RETURN
39490  REM  ----------------------------------------
39900  REM  PROCEDURE TO PRINT FREE SPACE----------
39905  PRINT
39910  PRINT "FREE MEMORY AVAILABLE NOW = "; FRE (0);" BYTES"
39915  PRINT
39920  RETURN
39930  REM ----------------------------------------
40000  REM    BEGIN DATA ENTRY PROCEDURAL SUBS -----
40007 PRINT "?"; : GOSUB 40300
40008  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40009  IF ZN$ = "" THEN 40090
40010 IF LEFT$(ZN$,4) = "MENU" THEN GOSUB 42900
40011  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40012  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN  GOSUB 50100
40013  IF  LEFT$ (ZN$,4) = "HELP" THEN  GOSUB 50100
40014  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40015  IF ZN$ = "HELP" THEN ZN$ = "0": GOTO 40037
40017  IF  VAL (ZN$) = 0 AND  LEFT$ (ZN$,1) <  > "0" THEN 40030
40019  GOTO 40090
40030 GOSUB 40210
40031 GOSUB 45
40035  PRINT  CHR$ (7);: GOSUB 51: PRINT "  THAT IS NOT A NUMBER - TRY AGAIN!   "; : GOSUB 50
40037  GOSUB 40100
40038  GOTO 40007
40060  REM     ZM MUST BE SET TO MESSAGE IN WINDOW LOCATION. & CLEAR REST OF SCREEN.
40061  GOSUB 43
40065  GOSUB 41
40070 GOSUB 40210
40080  IF  LEN (ZN$) <  > WL AND FL = 0 GOTO 40500
40090 ZN =  VAL (ZN$): RETURN
40095  REM  ----------------------------------------
40100  GOSUB 40 : RETURN
40110  REM   END PROCEDURE TO CONTROL DATA INPUT
40120 REM----------------------------------------
40150  REM   SUB TO CAUTION DATA OUTSIDE LIMITS
40160 GOSUB 40210
40165 ZN$ = ""
40170  PRINT  CHR$ (7);: GOSUB 51: PRINT "INPUT VALUE SHOULD BE BETWEEN ";
40172  PRINT LO;" AND ";HI;" RE - ENTER IT."; : GOSUB 50
40174  GOSUB 50
40180  RETURN
40190  REM  ----------------------------------------
40200  REM   CLEAR MESSAGE LOCUS ONLY
40210 LOCATE ZM,1,0: FOR I% =ZM TO 23 :PRINT SPC(79):NEXT I%
40212  PRINT SPC(80); : RETURN
40220  REM  ----------------------------------------
40230  REM   --PROCEDURE TO ADD HELPS TO ALPHA INPUT
40235  GOSUB 40300
40236  IF ZN$ = "B" AND  LEN (ZN$) = 1 AND K3 = 9 THEN  RETURN
40237 IF ZN$ = "" THEN RETURN
40238  IF  LEFT$ (ZN$,4) = "QUIT" OR  LEFT$ (ZN$,1) = QE$ THEN 42900
40240  IF ZN$ = "H" AND  LEN (ZN$) = 1 THEN 40255
40241  IF ZN$ = HE$ THEN 40255
40242  IF ZN$ = "?" AND  LEN (ZN$) = 1 THEN 40255
40245  IF  LEFT$ (ZN$,4) = "HELP" THEN 40255
40250  RETURN : REM   BACK TO INPUT PROCEDURE
40255  GOSUB 50100
40256 ZN$ = ""
40257  GOSUB 40100
40260  GOTO 40235
40265  REM  ---END PROCEDURAL SUB----------------
40300  REM  ...SUB ACCEPTS RETURN (ENTER) AS DEFAULT DATA INPUT.  SEE GOSUB 40000
40302 ZN$ = ""
40304 CH$ = INPUT$(1)
40306  IF CH$ = ES$ THEN 100
40308 I% =  ASC (CH$)
40310  IF I% > 96 AND I% < 123 THEN CH$ =  CHR$ (I% - 32): REM   CONVERT ALL ALPHA INPUT TO UPPER CASE?
40311  IF CH$ = CR$ THEN 40340
40312  IF CH$ = QE$ THEN 42900
40313  IF CH$ <> BS$ THEN 40321
40314  IF CH$ <  > NAK$ THEN 40316
40315 IF LEN(ZN$)=0 THEN PRINT " "; : LOCATE,POS(0)-1 : GOTO 40304
40316  PRINT CH$;
40317 ZN$ = LEFT$(ZN$,LEN(ZN$)-1)
40318  GOTO 40304
40319 LOCATE ,POS(0)-1 : PRINT " "; : LOCATE ,POS(0)-1
40320 GOTO 40304
40321 ZN$ = ZN$ + CH$
40322  PRINT CH$;
40323 REM
40325 GOTO 40304
40330  PRINT CH$;: GOSUB 43:ZN$ =  LEFT$ (ZN$, LEN (ZN$) - 1): GOTO 40304
40340  IF CH$ = CR$ AND  LEN (ZN$) = 0 THEN  RETURN
40350  IF CH$ = CR$ THEN  GOSUB 43: RETURN
40370  PRINT "WARNING LINE READ SUB FELL THROUGH ALL  TESTS.??": RETURN
40380  REM  ----------------------------------------
40400  REM   PROCEDURE TO PRINT LENGTH OF DATA PROMPT (REQUIRED OR MAXIMUM
40405  REM   PROPER USE REQUIRES POST GENBASIC CODING OF WL & FL'S
40410  PRINT  LEFT$ (SQ$,WL);
40420  IF FL > 0 THEN  PRINT "."; LEFT$ (SQ$,FL);
40430 CX = CH:CY = CV + LN: GOSUB 42
40440  RETURN
40450  REM   END PROCEDURAL SUB
40460  REM  ----------------------------------------
40500  REM    PROCEDURE TO VERIFY THE PROPER LENGTH OF CODED INPUT (ENTRY) * *
40510  IF  LEN (ZN$) = WL THEN  RETURN
40520  PRINT  CHR$ (7); CHR$ (7);
40530  GOSUB 41
40535  GOSUB 51
40537  PRINT "ENTRY IS CODED & MUST BE ";WL;" DIGITS LONG..RE-ENTER THE PROPER VALUE..."
40540  GOSUB 50
40541 CX = CH:CY = CV
40542  GOSUB 42: GOSUB 43
40550  GOSUB 40400
40560  GOSUB 40100
40570  GOTO 40010
40580  REM   END PROCEDURE
40590  REM  ----------------------------------------
40600 REM UNIVERSAL READER OF Y/N RESPONSES TO UPPERCASE Y & N
40610 LOCATE ,,1 : Z$ =INPUT$(1) :PRINT Z$; : IF Z$ = CR$ THEN Z$ = "N" : RETURN
40615 X$ = INPUT$(1)
40620 Z$=Z$+"N"
40630 I%=ASC( Z$)
40640 IF I% > 96 AND I% < 123 THEN Z$ = CHR$(I%-32) : RETURN
40650 Z$ = CHR$(I%) : RETURN
40660 REM END Y/N & LOWER CASE TO UPPER RESPONSE READER PROCEDURE -----
40700 REM SETUP DRIVE & FILE NAMES PROCEDURES ?
40990 REM----------------------------------------
41000 REM PROCEDURE TO COPY OVER A SEQUENTIAL FILE BEFORE ADDING DATA TO IT.
41010 ON ERROR GOTO 41900
41020 OPEN"I",#1,K$
41030 REM IF FILE EXISTS ,WRITE IT TI K1$
41040 OPEN "O",#2,K1$
41050 IF EOF(1) THEN 41090
41060 LINE INPUT #1,Z$
41070 PRINT #2,Z$
41080 GOTO 41050
41090 CLOSE#1
41100 REM WHEN TO KILL K$..BACKUP?
41110 RETURN
41200 REM ADD DATA TO #2
41300 REM CLOSE#2
41400 REM NAME K1$ AS K$ ?? HERE OR BEFORE CLOSE??
41900 REM CAPTURE NO FILE FOUND & START ONE AT THAT POINT
41910 IF ERR = 53 AND ERL =20 THEN OPEN"0",#2,K1$ : RESUME 41120
41920 ON ERROR GOTO 0
41930 REM----END FIE COPY PROCEDURE
42900  REM    EXIT & RE-RUN OPTIONS
42901  GOSUB 40210: GOSUB 41:PRINT
42902  LOCATE ,7: GOSUB 51:PRINT " WANT TO RE-RUN PROGRAM (Y OR N = RETURN TO MENU) ";:GOSUB 50
42903  GOSUB 40610
42904  IF  Z$ = "Y" THEN  GOSUB 38  : GOSUB 48700 :GOTO 90
42906  IF Z$ = "N" THEN 43000
42907 IF Z$ = "" THEN GOTO 43000
42998  IF Z$ = CR$ THEN END
42999  REM  ----------------------------------------
43000  REM    ...RETURN TO MENUSUB...PROCEDURE * *
43001  GOSUB 47000:GOSUB 48600
43002 KD$="MENU.BAS"
43003 CHAIN KD$
43004  REM  ----------------------------------------
45000 ZD = ZD* 100
45003 ZD = ZD+0.5
45005 ZD = INT(ZD)
45007 ZD = ZD/100
45009 ZD$ = STR$(ZD)
45010 RETURN
45110  REM  ----------------------------------------
45500 REM*******
45530 REM ERROR TRAPPING ROUTINE*******************
45532 EL = ERL: EC = ERR
45534 REM CLS:LOCATE 12,12
45536 GOSUB 51:PRINT CHR$(7):PRINT CHR$(7)
45538 PRINT "ERROR # ";EC;" HAS OCCURRED AT LINE ";EL;
45540 PRINT " SEE APPENDIX PAGES A3 - A11 OF THE BASIC MANUAL FOR MORE DETAILS."
45542 PRINT : PRINT TAB(20) : GOSUB 50 : PRINT"DON'T PANIC!"
45544 PRINT "It's possible to recover from most printer & disk errors without losing any data."
45546 PRINT "BUT DON'T EXIT FROM THIS PROGRAM.  Continue on for instructions."
45548 PRINT
45550 IF EC >52 THEN 45580
45552 IF EC <24 OR EC > 27 OR EC = 26 THEN 45655
45554 IF EC > 24 THEN 45540
45556 EM$="DEVICE TIMEOUT ERROR":RM$="PRINTER NOT CONNECTED OR SWITCHED ON ?"
45558 GOTO 45670
45560 IF EC > 25 THEN 45566
45562 EM$="DEVICE (PRINTER?) FAULT":RM$="LOOK FOR MECHANICAL-ELECTRICAL PRINTER PROBLEMS ?"
45564 GOTO 45670
45565 PRINT : PRINT"DO NOT PANIC (at least not yet)" : PRINT "It is possible to recover from certain errors without losing any data.": PRINT "DO NOT EXIT FROM THIS PROGRAM.  Continue on for instructions."
45566 EM$="PRINTER OUT OF PAPER":RM$="LOAD OR OTHERWISE FIX PAPER FLOW ?
45568 GOTO 45670
45570 REM ----END PRINTER ERRORS---BEGIN DISK ERRORS -------------
45580 IF EC <> 53 THEN 45590
45585 EM$ = "DISK OR DATA FILE NOT FOUND" : RM$ = "DID YOU USE THE CORRECT DISK,DRIVE,OR FILENAME ETC.?":GOTO 45670
45590 IF EC <> 54 THEN 45600
45595 EM$ = "DEVICE (DISK?) INPUT/OUTPUT ERROR":RM$ = "IS DISK BAD..UN-FORMATTED..ETC? TRY AGAIN.":GOTO 45670
45600 IF EC <> 57 THEN 45610
45605 EM$ = "DISK FULL" : RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45610 IF EC <> 61 THEN 45620
45615 EM$ = "DISK IS WRITE PROTECTED" : RM$ = "REMOVE THE WRITE PROTECT TAB OR USE A DIFFERENT DISK.":GOTO 45670
45620 IF EC <> 67 THEN 45630
45625 EM$ = "TOO MANY FILES ON THIS DISK" :RM$ = "USE A DIFFERENT DISK." : GOTO 45670
45630 IF EC <> 71 THEN 45640
45635 EM$ = "DISK IS NOT READY TO READ/WRITE" : RM$ = "DRIVE DOOR OPEN --NO DISK IN DRIVE ?":GOTO 45670
45640 IF EC <> 72 THEN 45655
45645 EM$ = "DISK MEDIA ERROR":RM$ = "DISK IS `BAD' ? -- USE A DIFFERENT DISK ?
45650 GOTO 45670
45655 PRINT "SEE BASIC MANUAL PAGES A3 TO A11" : PRINT "CAN'T RECOVER AS SUCH--WANT TO CONTINUE FOR MORE CLUES ?"
45660 PRINT"ENTER `Y' TO CONTINUE -- `N' TO START OVER OR QUIT "; : GOSUB 40610
45665 IF Z$ = "Y" THEN RESUME ELSE FLAG = 23 : GOTO 45670
45670 REM LOCATE 5,5
45672 PRINT"ERROR #";EC;"  ";EM$
45674 REM LOCATE 7,5
45675 LOCATE 7,5: PRINT"REMEDY/SUGGESTION:  ";RM$
45676 PRINT"REMEDY/SUGGESTION:  ";RM$
45677 IF FLAG = 23 THEN GOSUB 49000 : FLAG = 0 : GOTO 42900
45678 IF FLAG = 23 THEN GOSUB 49007 : FLAG = 0 : GOTO 42900
45680 REM LOCATE 10,5
45682 PRINT"AFTER ERROR HAS BEEN CORRECTED, PRESS ANY KEY TO TRY AGAIN. GOOD LUCK.": Z$ = INPUT$(1)
45684 RESUME 100
45690 REM ?? IF FLAG = 2 THEN RESUME 20050 ELSE IF FLAG = 1 THEN RESUME 100 ELSE RESUME 21780
45900 REM
46000  REM   STANDARD DECAIDS MAIN MENU OPTIONS-
46005 GOSUB 38
46010  PRINT : PRINT SPC(20)"KEY-NO     OPTION OR ACTION DESCRIPTION"
46015  PRINT : PRINT SPC(20)" 0   END THE RUN - RETURN TO MENU,"
46020  PRINT : PRINT SPC(20)" 1   PROCEED TO ENTER DATA & DO A RUN,"
46025  PRINT : PRINT SPC(20)" 2   DISPLAY AN EXAMPLE DATA ANALYSIS,"
46030  PRINT : PRINT SPC(20)" 3   SEE FURTHER RUN-TIME INSTRUCTIONS,"
46035  PRINT : PRINT SPC(20)" 4   PRINT USER GUIDE & QUESTIONNAIRE,"
46040 PRINT : PRINT SPC(20)" 5   PRINTED RESULTS WANTED/NOT WANTED."
46045 GOSUB 39470
46050  PRINT : PRINT SPC(20)"KEY-IN THE SELECTED OPTION (0-5) ";
46055  INPUT S9: IF S9 < 0 OR S9 > 5 THEN 46005
46060  IF S9 = 0 THEN 42900
46065  IF S9 > 2 THEN 46085
46070  IF S9 = 2 THEN K9 = 0 : S9 = 4 : RETURN
46075  S9 = 5 : RETURN
46080 REM NOTE S9 = 4 & 5 ABOVE IS TO BE CONSISTENT WITH SCREENIN SWITCH SETTINGS ( COULD CHANGE)
46085  IF S9 <>5 THEN 46100
46090 PRINT :PRINT : GOSUB 39460
46092 IF PR$="Y" THEN PRINT :  PRINT TAB(20)"BE SURE THAT THE PRINTER IS TURNED ON" : GOSUB 49007
46095  GOTO 46005
46100  IF S9<> 4 THEN 46135
46105 PQ$ = "Y": GOSUB 48280
46110 GOSUB 500
46115 GOSUB 49100
46120 GOSUB 48020
46125 PQ$ = "N"
46130  GOTO 46005
46135  GOSUB 500
46140  GOTO 46005
46145  REM  END MAIN MENU SELECTION PROCEDURE
46150  REM ----------------------------------------
47000  REM BEGIN CREDITS PROCEDURAL SUB * *
47005 RETURN
47010  GOSUB 38
47020 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I: PRINT
47030  PRINT SPC(20)"!   12/10/83         IBM-PC  VERSION  !"
47040  PRINT SPC(20)"!                                     !"
47050  PRINT SPC(20)"!    MINN-AID SOFTWARE A PRODUCT OF   !"
47060  PRINT SPC(20)"!                THE                  !"
47070  PRINT SPC(20)"!       UNIVERSITY OF MINNESOTA       !"
47080  PRINT SPC(20)"!                                     !"
47090  PRINT SPC(20)"!   AGRICULTURAL EXPERIMENT STATION   !"
47095  PRINT SPC(20)"!          PROJECT 14-036             !"
47100  PRINT SPC(20)"!                 &                   !"
47110  PRINT SPC(20)"!   AGRICULTURAL EXTENSION SERVICE    !"
47120  PRINT SPC(20)"!                THE                  !"
47130  PRINT SPC(20)"! DEPT. OF AGRICULTURAL & APPLD. ECON.!"
47135  PRINT SPC(20)"!                                     !"
47140  PRINT SPC(20)"!       DESIGNED/DEVELOPED BY         !"
47150  PRINT SPC(20)"!          EARL I. FULLER             !"
47155  PRINT SPC(20)"!                                     !"
47160  PRINT SPC(20)"!      PROGRAMMER(S)/CONTACT(S)       !"
47170  PRINT SPC(20)"!                                     !"
47180  PRINT SPC(20)"!   A FARM MANAGEMENT DECISION AID    !"
47190  PRINT SPC(20)"---------------------------------------"
47200  PRINT
47210  GOSUB 49000
47220  RETURN
47230  REM   END CREDITS PROCEDURE SUB
47300  REM    INITIAL SCREEN PROCEDURE SUB
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   12/10/83              IBM - PC    !"
47344  PRINT SPC(20)"!                                     !"
47350  PRINT SPC(20)"!      SOWINDEX EVALUATES SOW         !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!    PRODUCTIVITY ON AN INDIVIDUAL    !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"!     AND HERD CAMPARISON BASES       !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"
47490 REM
47491 PRINT:PRINT
47492 PRINT SPC(10);"This is Test Version 4.0.   Comments on it's features and suggestions"
47493 PRINT SPC(10);"for improvements in it are welcome."
47494 REM
47496  GOSUB 48900
47497 RETURN
47498  REM  ---------------------------------
48000  REM BEGIN CREDITS PROCEDURAL SUB * *"
48010  GOSUB 38
48020 REM
48030  LPRINT "!   12/10/83        IBM - PC VERSION  !"
48040  LPRINT "!                                     !"
48050  LPRINT "!    MINN-AID SOFTWARE A PRODUCT OF   !"
48060  LPRINT "!                THE                  !"
48070  LPRINT "!       UNIVERSITY OF MINNESOTA       !"
48080  LPRINT "!                                     !"
48090  LPRINT "!   AGRICULTURAL EXPERIMENT STATION   !"
48095  LPRINT "!          PROJECT 14-036             !"
48100  LPRINT "!                 &                   !"
48110  LPRINT "!   AGRICULTURAL EXTENSION SERVICE    !"
48120  LPRINT "!                THE                  !"
48130  LPRINT "! DEPT. OF AGRICULTURAL & APPLD. ECON.!
48140  LPRINT "!                                     !"
48150  LPRINT "!       DESIGNED/DEVELOPED BY         !"
48160  LPRINT "!          EARL I. FULLER             !"
48170  LPRINT "!                                     !"
48180  LPRINT "!      PROGRAMMER(S)/CONTACT(S)       !"
48190  LPRINT "!                                     !"
48200  LPRINT "!   A FARM MANAGEMENT DECISION AID    !"
48210  LPRINT "---------------------------------------"
48220 LPRINT
48230  GOSUB 49007
48240  RETURN
48250  REM   END CREDITS PROCEDURE SUB
48260  REM   INITIAL SCREEN PROCEDURE SUB
48270  GOSUB 38
48280  FOR I = 1 TO 39: LPRINT  CHR$ (45);: NEXT I: LPRINT
48290  LPRINT "!                                     !"
48300  LPRINT "!   12/10/83              (IBM - PC)  !"
48310  LPRINT "!      SOWINDEX EVALUATES SOW         !"
48320  LPRINT "!                                     !"
48330  LPRINT "!    PRODUCTIVITY ON AN INDIVIDUAL    !"
48340  LPRINT "!                                     !"
48350  LPRINT "!     AND HERD CAMPARISON BASES       !"
48360  LPRINT "!                                     !"
48370  LPRINT "---------------------------------------"
48380 LPRINT : LPRINT
48390  RETURN
48500 REM***   RESETS SOFTKEYS TO SPECIAL USES AND DISABLES THE REST
48510 LOCATE ,,0 : KEY 1,"HELP"
48520 KEY 3,"MENU"
48530 KEY 5,"QUIT"
48540 KEY 2,"":KEY 9,"":KEY 4,"":KEY 6,"":KEY 7,"":KEY 8,"":KEY 10,""
48550 RETURN
48600 REM***   RESETS SOFTKEYS TO DEFAULT BASIC USES
48610 KEY 1,"LIST":KEY 2,"RUN"+CHR$(13):KEY 3,"LOAD"+CHR$(34):KEY 4,"SAVE"+CHR$(34):KEY 5,"CONT"+CHR$(13)
48620 KEY 6,CHR$(44)+"LPT1:"+CHR$(13):KEY 7, "TRON"+CHR$(13):KEY 8,"TROFF"+CHR$(13):KEY 9, "KEY":KEY 10, "SCREEN 0,0,0"+CHR$(13)
48630 LOCATE ,,1,12,13 : RETURN
48690 REM***   TOGGLES DISPLAY OF SOFTKEYS
48700 KEY OFF:RETURN
48710 KEY ON:RETURN
48890 REM*** PRINTS OUT BEGINNING MESSAGE CONCERNING HARD COPY
48900 LOCATE 19,1
48910 LOCATE ,9:GOSUB 51:PRINT"  FOR A PRINTOUT OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc*'.  ":GOSUB 50 : GOSUB 49007 : RETURN
49000  REM     SUB PROCEDURE TO PAUSE ON SCREEN * *
49005  IF PR$ = "Y" THEN  RETURN
49007  LOCATE 24,1
49010  PRINT SPC(20)"* * PAUSE..PRESS ANY KEY TO CONTINUE *";: Z$=INPUT$(1)
49015  IF Z$ = ES$ THEN 100
49020  IF Z$ = "" THEN 49010
49030 GOSUB 38  : RETURN
49040  REM   END PAUSE PROCEDURE
49050  REM   ---------------------------------------
49100  REM      PROCEDURE TO PRINT OUT QUESTIONARE AS QQ$(I) * *
49110  REM    BESURE TO MAKE A HEADER AND STORE AS VARIABLE QA$ (STRING ) SOURCE,TITLE ETC.
49114 WIDTH "LPT1:",132
49116 LPRINT SM$;
49120 QA$ = "?????? PUT A TITLE HERE"
49130  REM   TOGGLE PRINTER? GOSUB 39400
49135  LPRINT : LPRINT "INPUT DATA QUESTIONAIRE FOR :"
49140  LPRINT : LPRINT QA$
49148 IDO = 2: REM   DOUBLE SPACE PRINT
49149  REM    K2 = NO OF QUESTIONS
49150  FOR I = 1 TO K2
49160  IF IDO > 1 THEN  LPRINT
49170  LPRINT I;" ";QQ$(I);" -----------    -----------"
49172  NEXT I
49174  LPRINT : LPRINT
49176  FOR LQ = 1 TO K2
49178  IF IDO > 1 THEN  LPRINT
49182  GOSUB 50105
49184  NEXT LQ
49186  LPRINT : LPRINT
49188  REM GOSUB 39440
49189 LPRINT BG$;:PQ$="N"
49190  RETURN
49199  REM    END PROCEDURAL SUB...* *
49200  REM  ----------------------------------------
49900  REM     ADDED INPUT INSTRUCTIONS PROCEDURE AT SCREEN ERROR LOCATION
49910 GOSUB 41
49920  GOSUB 51:PRINT
49930 PRINT"SPECIAL INPUT KEYS; F1 = HELP, F5 = GOTO MENU, F9 = QUIT = STOP RUN,":PRINT"<CR> = RETURN = GOTO NEXT PROMPT";
49940  GOSUB 50:LOCATE ,,1,0,11
49945 GOSUB 48500:GOSUB 48710 : LOCATE ,,1
49950  Z$ = INPUT$(1)
49955  IF Z$ = ES$ THEN 100
49957  IF Z$ = QE$ THEN 42900
49960  RETURN
49990  REM   --------------------------------
50100  REM    LOCUS OF HELP SUBS TO ADD ENTRY COMMENTS
50102  GOSUB 41
50103  GOSUB 51
50104  IF LQ < 1 THEN 50110
50105  IF LQ > 9 GOTO 50200
50106  ON LQ GOTO 50110,50120,50130,50140,50150,50160,50170,50180,50190,50200
50108  GOTO 50300
50110  LQ$ = "MAY BE EARTAG/NOTCH/8 CHARACTER NAME OR ANY ID NUMBER"
50119  GOTO 50300
50120  LQ$ = "MUST BE A 'G' IN THE 1ST SPACE TO BE CONSIDERED AS A GILT"
50129  GOTO 50300
50130  LQ$ = "INDEX IS ONLY CONSIDERED VALID FOR THE RANGE SPECIFIED"
50139  GOTO 50300
50140  LQ$ = "MEASURES MILKING ABILITY DON'T USE AVERAGE PER DAY NO.?"
50149  GOTO 50300
50150  LQ$ = "TOTAL FOR LITTER IN POUNDS ON THE WEIGHING DAY"
50159  GOTO 50300
50160  LQ$ = "EXCLUDE MUMMIES ETC. MEASURES PROFUNDITY OF FEMALE + BOARS(S)"
50300 IF PQ$="Y" THEN LPRINT LQ;"/ ";LQ$:RETURN
50310 PRINT LQ$; : GOSUB 50 : Z$=INPUT$(1) : RETURN
53025 REM ------------------------------------------

STEERBID.BAS

1 KEY OFF : DIM LQ$(13) : DIM LL$(7,5) : DIM D(13)
5 REM IBM-PC VERSION ENHANCED BY JOEL KUNZE
100  GOSUB 200 : CLS:PRINT:PRINT "PROGRAM TO CALCULATE FED STEERS MARKETING DECISION ALTERNATIVES"
110  PRINT"BASED ON LIVEWEIGHT SHRINK AND HOT CARCASS WEIGHT DUE TO"
120  PRINT"FEEDING CONDITIONS, SCALE WEIGHTING ARRANGEMENTS & THEIR INTERACT-"
130  PRINT"IONS, DAILY RATE OF GAIN DURING LAST 30 DAYS, ESTIMATED FEEDLOT"
140  PRINT"WEIGHT, CARCASS QUALITY GRADE SCORE, CARCASS YIELD GRADE SCORE,"
150  PRINT"AND HAULING DISTANCE TO MARKETS."
155 PRINT: PRINT"HIT ANY KEY TO CONTINUE" : Z$ = INPUT$(1) : GOTO 300
160  REM  SOURCE : RONALD RAIKES,ET.AL., IA.S.U. AG.EX.ST. SP-82 05/79
170  REM  PROGRAMMER : TJEPPY D. SOEDJANA. DEPARTMENT OF AGRICULTURAL AND
180  REM  APPLIED ECONOMICS, UNIVERSITY OF MINNESOTA, SAINT PAUL, FEB -81.
190  REM   INHANCED BY EARL FULLER JULY 81
200  CLS
201 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
202  PRINT SPC(20)"!                                     !"
203  PRINT SPC(20)"!    1/04/84              IBM - PC    !"
204  PRINT SPC(20)"!              STEERBID               !"
205  PRINT SPC(20)"!                                     !"
206  PRINT SPC(20)"!        CALCULATES FED STEERS        !"
207  PRINT SPC(20)"!                                     !"
208  PRINT SPC(20)"!        MARKETING ALTERNATIVES       !"
209  PRINT SPC(20)"!                                     !"
210  PRINT SPC(20)"---------------------------------------"
215 PRINT : PRINT : LOCATE ,7: COLOR 0,7 :PRINT"TO OBTAIN HARDCOPY OF ANY SCREEN PRESS 'SHIFT' AND 'PrtSc *'AT THE SAME TIME." : COLOR 7,0
260 PRINT : PRINT : PRINT :PRINT : PRINT SPC(27)"HIT ANY KEY TO CONTINUE" : Z$ = INPUT$(1) : RETURN
300 CLS
350  LQ$(1)= "1. DESCRIBE CATTLE OR MARKET CHOICES "
390  LQ$(2)="2. DISTANCE TO LIVE WEIGHT MARKET (MILES) "
460  LQ$(3)= "3. FEED LOT CONDITIONS ARE :"
480  LL$(3,1)="1 = UNSHELTERED HOUSING"
490  LL$(3,2)="2 = PARTLY SHELTERED HOUSING"
500  LL$(3,3)="3 = CONFINEMENT BUILDING"
520  LL$(3,4)="THE BEST DESCRIPTION IS : "
590  LQ$(4)="4. OVERNIGHT & SCALE CODES ARE : "
610  LL$(4,1)= "1 = HOLD AT FARM WITHOUT FEED AND WATER"
620  LL$(4,2)="2 = HOLD AT FARM WITHOUT FEED"
630  LL$(4,3)="3 = HOLD AT PLANT WITHOUT FEED AND WATER"
640  LL$(4,4)="4 = SOLD TO TERMINAL WITH NO RESTRICTION"
660  LL$(4,5)="WHICH CODE IS MOST CORRECT : "
690  LQ$(5)= "5. AVERAGE FINISHED FEEDLOT WEIGHT (LBS.) "
720  LQ$(6)= "6. DAILY RATE OF GAIN DURING LAST 30 DAYS (LBS.) "
750  LQ$(7)= "7. ENTER CARCASS QUALITY GRADE  (0=LOW TO 12 = HIGH)"
752  LL$(7,1)= "1=LOW STANDARD...4=LOW GOOD...7=LOW CHOICE...10=LOW PRIME..."
780  LQ$(8)= "8. CARCASS YIELD GRADE SCORE (1=HIGH TO 5.9=LOW) "
810  LQ$(9)= "9. PENCIL SHRINK USED IN LIVE-WEIGHT BID (%) "
840  LQ$(10)= "10. TRANSPORTATION COST TO LIVE-WEIGHT  MARKET ($/CWT.) "
870  LQ$(11)= "11. TRANSPORTATION COST TO HOT-CARCASS MARKET ($/CWT.) "
880  LQ$(12)= "12. ENTER LIVE-WEIGHT PRICE BID ($/CWT) "
890  LQ$(13)= "13. ENTER HOT-CARCASS PRICE BID ($/CWT) "
900 K2 = 3 : J = 0 : GOSUB 2500
910 K2 = 6 : GOSUB 2500
920 K2 = 4 : GOSUB 2500
925 CLS
930 D1 = D(2) : H = D(3) : M = D(4) : F = D(5) : G = D(6) : Q = D(7)
940 Y = D(8) : P =D(9) : T1 = D(10) : T2 = D(11) : P1 = D(12) : P2= D(13)
950 REM START CALCULATIONS
960 I = (F * 0.63) + (G * ( - 2.99)) + (Q * 0.84) + (Y * 6.52)
970 G1 = G * 0.15
980  GOSUB 1820
990  GOSUB 1940
992 S =  INT (S * 100 + 0.5) / 100
993 C =  INT (C * 100 + 0.5) / 100
995 F1 = F * (0.01 * (P + S))
996 F1 =  INT ((F - F1) * 100 + 0.5) / 100
1000 L = P1 * (1 - 0.01 * (P + S)) - T1
1001 L =  INT (L * 100 + 0.5) / 100
1003 T3 = T2 - T1
1005 E1 = ((F1 * (P1 + T3)) / C1)
1006 E1 =  INT (E1 * 100 + 0.5) / 100
1010 C = P2 * (C1 / F) - T2
1011 C =  INT (C * 100 + 0.5) / 100
1015 E2 = ((C1 * P2) / F1) - T3
1016 E2 =  INT (E2 * 100 + 0.5) / 100
1020  PRINT
1030 REM
1040  PRINT "DESCRIPTION OF CATTLE OR ALTERNATIVES     : ";N$
1042  PRINT "FINISHING AT ";F;" LBS.": PRINT "GAINING ";G;" LBS PER DAY-LAST 30 DAYS"
1044  PRINT "QUALITY GRADE SCORE = ";Q
1046  PRINT "QUALITY GRADE SCORE = ";Y
1050  PRINT
1060  PRINT "PREDICTED PERCENTAGE LIVEWEIGHT SHRINK    : "S;" PERCENT "
1062  PRINT "( ";D1;" MILES TO LIVE MARKET)"
1065  PRINT "PREDICTED  LIVE-SALE-WEIGHT               : "F1;" LBS "
1070  PRINT "PREDICTED HOT-CARCASS WEIGHT              : "C1;" LBS "
1071  PRINT : PRINT "QUOTED HOT-CARCASS PRICE                  : $"P2
1072  PRINT "QUOTED LIVE-WEIGHT BID PRICE              : $"P1
1074  PRINT
1076  PRINT "HIT ANY KEY TO CONTINUE ": QQ$=INPUT$(1)
1080 CLS
1090  PRINT "COMPARABLE FARM-GATE LIVEWEIGHT PRICE IS  : $";L
1100  PRINT "COMPARABLE LIVEWEIGHT FARM-GATE TO THE"
1105  PRINT "   QUOTED HOT-CARCASS PRICE WOULD BE      : $";C
1110  PRINT "REQUIRED HOT-CARCASS PRICE TO MATCH TO THE"
1115  PRINT "   LIVEWEIGHT QUOTED PRICE IS             : $";E1
1117  PRINT
1120  PRINT "LIVEWEIGHT MARKET PRICE THAT MATCHES"
1121  PRINT "   THE HOT-CARCASS QUOTED PRICE IS        : $";E2
1122  PRINT
1140  IF L < C GOTO 1180
1150  PRINT
1160  PRINT "SELLING LIVEWEIGHT YIELDS GREATER RETURNS"
1165  PRINT : PRINT : PRINT
1170 GOTO 1814
1180  PRINT ,"SELLING HOT-CARCASS IS MORE PROFITABLE"
1190  PRINT : PRINT : PRINT
1814 PRINT :PRINT"HIT ANY KEY TO CONTINUE" : Z$ = INPUT$(1) : GOTO 2650
1820  REM  CALCULATION OF DISTANCE'S IMPACT ESTIMATOR
1830  IF D1 >  = 40 GOTO 1880
1840  IF D1 >  = 80 GOTO 1900
1850  IF D1 >  = 120 GOTO 1920
1860 D =  - 0.46
1870  GOTO 1930
1880 D = D1 * 0.0145 - 1.04
1890  GOTO 1930
1900 D = D1 * 0.0055 - 0.32
1910  GOTO 1930
1920 D = 0.34
1930  RETURN
1940  REM  CALCULATION OF MARKETING IMPACT ESTIMATORS
1950  IF H = 1 GOTO 1980
1960  IF H = 2 GOTO 2150
1970  IF H = 3 GOTO 2320
1980  REM  UNDER UNSHELTERED HOUSING CONDITION
1990  ON M GOTO 2000,2030,2060,2090,2120
2000 S = 3.38 + G1 + D
2010 C1 =  - 47.7 + I
2020  GOTO 2140
2030 S = 3.18 + G1 + D
2040 C1 =  - 38.23 + I
2050  GOTO 2140
2060 S = 4.2 + G1 + D
2070 C1 =  - 50.83 + I
2080  GOTO 2140
2090 S = 3.68 + G1 + D
2100 C1 =  - 49.62 + I
2110  GOTO 2140
2120 S = 2.3 + G1 + D
2130 C1 =  - 48.48 + I
2140  RETURN
2150  REM  UNDER PARTLY SHELTERED HOUSING CONDITION
2160  ON M GOTO 2170,2200,2230,2260,2290
2170 S = 3.6 + G1 + D
2180 C1 =  - 48.85 + I
2190  GOTO 2310
2200 S = 3.9 + G1 + D
2210 C1 =  - 39.34 + I
2220  GOTO 2310
2230 S = 4.19 + G1 + D
2240 C1 =  - 51.94 + I
2250  GOTO 2310
2260 S = 3.29 + G1 + D
2270 C1 =  - 50.73 + I
2280  GOTO 2310
2290 S = 2.1 + G1 + D
2300 C1 =  - 49.59 + I
2310  RETURN
2320  REM  UNDER CONFINEMENT BUILDING CONDITION
2330  ON M GOTO 2340,2370,2400,2430,2460
2340 S = 2.98 + G1 + D
2350 C1 =  - 37.06 + I
2360  GOTO 2480
2370 S = 1.67 + G1 + D
2380 C1 =  - 27.55 + I
2390  GOTO 2480
2400 S = 3.58 + G1 + D
2410 C1 =  - 40.15 + I
2420  GOTO 2480
2430 S = 2.31 + G1 + D
2440 C1 =  - 38.94 + I
2450  GOTO 2480
2460 S = 2.36 + G1 + D
2470 C1 =  - 37.8 + I
2480  RETURN
2490 CHAIN "MENU.BAS"
2500 REM INPUT SUBROUTINE :FLAG = 0
2505 CLS : PRINT
2506 IF K2 = 3 THEN J = 0
2507 IF K2 = 6 THEN J = 3
2508 IF K2 = 4 THEN J = 9
2510 FOR I = 1 TO K2
2515 J = J+1
2520 PRINT : PRINT LQ$(J);
2525 IF J = 3 THEN K3 = 4 :GOSUB 2600
2530 IF J = 4 THEN K3 = 5 : GOSUB 2600
2535 IF J = 7 THEN K3 = 1 : GOSUB 2600
2540 IF J = 1 THEN GOSUB 2575 : GOTO 2555
2545 IF FLAG = 1 THEN PRINT D(J);:CX = POS(0) :CX = CX-LEN(STR$(D(J))): LOCATE ,CX-2,1
2550 INPUT WW : IF FLAG < > 1 THEN D(J)= WW
2555 NEXT I
2557 FLAG = 0
2560 PRINT : COLOR 0,7 : PRINT "DATA OK? (Y/N) Q =QUIT ENTIRE ANALYSIS";:COLOR 7,0 : INPUT Z$
2563 Z$ = LEFT$(Z$,1)
2565 IF Z$ = "N" OR Z$= "n" THEN FLAG = 1 : GOTO 2505
2567 IF Z$ = "q" OR Z$ = "Q" THEN GOTO 2650
2570 RETURN
2575 REM INPUT FOR FIRST QUESTION
2580 IF FLAG <>1 THEN 2590
2585 PRINT " "; :PRINT N$;:CX = POS(0) : CX=CX-LEN(N$) :LOCATE , CX-2,1
2590 INPUT WW$ : IF FLAG < > 1 THEN N$ = WW$
2595 RETURN
2600 REM
2605 PRINT " ": FOR K = 1 TO K3
2610 PRINT LL$(J,K);
2615 IF K < > K3 THEN PRINT " "
2620 NEXT K
2625 RETURN
2650 REM EXIT SUBROUTINE
2655 CLS : PRINT : PRINT : INPUT"DO YOU WISH TO RE-RUN THIS PROGRAM (Y OR N = BACK TO MENU)";Z$
2657 Z$ = LEFT$(Z$,1)
2660 IF Z$ = "n" OR Z$ = "N" THEN CHAIN "MENU.BAS"
2670 GOTO 100
3000 END
47310  GOSUB 38
47320 PRINT TAB(21): FOR I = 1 TO 39: PRINT  CHR$ (45);: NEXT I:PRINT
47340  PRINT SPC(20)"!                                     !"
47342  PRINT SPC(20)"!   12/10/83              IBM - PC    !"
47350  PRINT SPC(20)"!              SKELETON               !"
47360  PRINT SPC(20)"!                                     !"
47370  PRINT SPC(20)"!            FOR USE WITH             !"
47380  PRINT SPC(20)"!                                     !"
47390  PRINT SPC(20)"!        GENBASIC APPLICATIONS        !"
47470  PRINT SPC(20)"!                                     !"
47480  PRINT SPC(20)"---------------------------------------"

ULOGO.BAS

100 REM************************************************************************
110 REM***  UNIVERSITY OF MINNESOTA LOGO PROGRAM  2-9-84   JOEL P. KUNZE    ***
120 REM************************************************************************
130 KEY OFF: COLOR 0,7: CLS:D$="":E$="":F$=""
140 FOR I = 1 TO 8
150 IF I > 6 THEN 190
160 IF I > 5 THEN 180
170 F$ = F$ + CHR$(219)
180 E$ = E$ + CHR$(219)
190 D$ = D$ + CHR$(219)
200 NEXT I:COLOR 7,0
210 LOCATE 2,2,0:PRINT SPC(78)
220 COLOR 0,7:FOR I = 3 TO 23 :LOCATE I,2:PRINT E$+CHR$(219): NEXT I
230 FOR I = 3 TO 23:LOCATE I,73:PRINT E$+CHR$(219): NEXT I
240 COLOR 7,0:FOR I = 23 TO 24 :LOCATE I,2:PRINT SPC(78);:NEXT I
250 COLOR 0,7:LOCATE 19,9:PRINT CHR$(220):LOCATE 20,9:PRINT CHR$(219)+CHR$(220):LOCATE 21,9:PRINT CHR$(219)+CHR$(219)+CHR$(220):LOCATE 22,9:PRINT F$+CHR$(220)+CHR$(220)
260 COLOR 0,7:FOR I = 3 TO 18
270 LOCATE I,17:IF I > 14 THEN PRINT D$+D$ ELSE PRINT D$
280 NEXT I:COLOR 0,7:LOCATE 11,39:PRINT CHR$(223)+CHR$(219):LOCATE 7,47:PRINT CHR$(220):LOCATE 8,47:PRINT CHR$(219)+CHR$(221):LOCATE 11,55:PRINT CHR$(223)+CHR$(219)
290 COLOR 0,7:FOR I = 7 TO 22
300 IF I < 9 THEN LOCATE I,33:PRINT D$+E$:GOTO 330
310 IF I < 11 THEN LOCATE I,33:PRINT D$+D$:GOTO 330
320 LOCATE I,41:PRINT D$
330 NEXT I
340 FOR I = 7 TO 22
350 IF I<11 THEN LOCATE I,51:PRINT D$+E$:GOTO 370
360 LOCATE I,57:PRINT D$
370 NEXT I
380 COLOR 0,7:LOCATE 3,66:PRINT CHR$(223)+CHR$(223)+F$
390 LOCATE 4,70:PRINT CHR$(223)+CHR$(219)+CHR$(219)
400 LOCATE 5,71:PRINT CHR$(223)+CHR$(219)
410 LOCATE 6,72:PRINT CHR$(223)
415 LOCATE 24,26:PRINT" UNIVERSITY OF MINNESOTA ";
420 Z$ = INPUT$(1):COLOR 7,0:CLS : CHAIN "MENU.BAS"

USERDOCS.BAS

38000 PRINT TAB(20)"USER DOCUMENTATION of MINN-AIDS"
38005 PRINT TAB(17)"(Microsoft BASIC CP/M & MSDOS versions)"
38010 PRINT  TAB( 4)"Most of the MINN-AIDS programs contain internal documentation.  Hard "
38015 PRINT "copies of it may be obtained by actually running the program.   Once in "
38020 PRINT "printed form appropriate paging, with possibly some cutting and pasting,"
38025 PRINT "provides copy suitable for 3-hole punching.  Filing in a user's notebook"
38030 PRINT "makes a useful reference.  Such a notebook gives new users a printed"
38035 PRINT "explaination of what it does, what data is required and how to enter data."
38040 PRINT ""
38045 PRINT "    First run the program and select the printed input questionaire option."
38050 PRINT "This provides a copy of the introduction screen, the basic description screen,"
38065 PRINT "the input questions themselves and a set of explainatory footnotes (actually"
38070 PRINT "on line HELPS during data entry).   A reference page completes this option."
38075 PRINT ""
38080 PRINT  TAB( 4)"Then run either or both of the regular and sample run options.   Screens"
38085 PRINT "may be printed verbatium by use of your systems special instructions to do so."
38090 PRINT "Output will usually be printed automatically.   Notes on the margins may also "
38095 PRINT "help a new user.  So might selected reference material filed in the user "
38100 PRINT "notebook.   In as much as inhancements continue on most of these programs, the"
38105 PRINT "developers would appreciate hearing from you concerning errors, improvements,"
38110 PRINT "and suggestions for added clarity in the screens and printed results.   Our "
38115 PRINT "phone is (612) 373-1145.  Address is Dept of Agricultural & Applied Economics"
38120 PRINT "249 COB, Univ. of Minn., St. Paul Mn., 55108."
38130 PRINT "............Want a printed copy of this set of suggestions (Y or N) ";
38135 INPUT Z$ :Z$ =LEFT$(Z$,1) : IF Z$ <> "Y" AND Z$ <> "y" THEN CHAIN"MENU.basOk
38140 REM REPEATED MESSAGE FOR PRINTER (DELETE 'GOSUBS' 49000)
38145 LPRINT TAB(20)"USER DOCUMENTATION of MINN-AIDS"
38150 LPRINT TAB(17)"(Microsoft BASIC CP/M & MSDOS versions)"
38155 LPRINT "    Most of the MINN-AIDS programs contain internal documentation.  Hard "
38160 LPRINT "copies of it may be obtained by actually running the program.   Once in "
38165 LPRINT "printed form appropriate paging, with possibly some cutting and pasting,"
38170 LPRINT "provides copy suitable for 3-hole punching.  Filing in a user's notebook"
38175 LPRINT "makes a useful reference.  Such a notebook gives new users a printed"
38180 LPRINT "explaination of what it does, what data is required and how to enter data."
38185 LPRINT ""
38190 LPRINT "    First run the program and select the printed input questionaire option."
38195 LPRINT "This provides a copy of the introduction screen, the basic description screen,"
38210 LPRINT "the input questions themselves and a set of explainatory footnotes (actually"
38215 LPRINT "on line HELPS during data entry).   A reference page completes this option."
38220 LPRINT ""
38225 LPRINT "    Then run either or both of the regular and sample run options.   Screens"
38230 LPRINT "may be printed verbatium by use of your systems special instructions to do so."
38235 LPRINT "Output will usually be printed automatically.   Notes on the margins may also "
38240 LPRINT "help a new user.  So might selected reference material filed in the user "
38245 LPRINT "notebook."
38247 LPRINT : LPRINT "   In as much as inhancements continue on most of these programs, the"
38250 LPRINT "developers would appreciate hearing from you concerning errors, improvements,"
38255 LPRINT "and suggestions for added clarity in the screens and printed results.   Our "
38260 LPRINT "phone is (612) 373-1145.  Address is Dept of Agricultural & Applied Economics"
38265 LPRINT "249 COB, Univ. of Minn., St. Paul Mn., 55108."
38270 LPRINT ""
38275 CHAIN"MENU.BAS

Directory of PC-SIG Library Disk #0459

 Volume in drive A has no label
 Directory of A:\

ACRSCALC BAS     30976   1-01-80   1:16a
AUTOEXEC BAT       128  11-10-84  12:01a
BESTCROP BAS     24448   1-01-80   7:16a
DATECALC BAS      9600   3-12-84   6:13p
DRYSTORE BAS     32000   1-01-80   1:23a
FARMBID  BAS     29568   1-01-80   1:28a
FEEDPIGS BAS     32512   1-01-80   1:24a
FEEDSILO BAS      3968   3-12-84   6:15p
FEEDVALU BAS     21632   1-01-80   7:08a
FILES459 TXT      1981   1-31-87   3:17p
MENU     BAS      6016   1-01-80  12:02a
PEARSON  BAS     27008   1-01-80   1:24a
READ     BAT       256  11-10-84  12:02a
README   DOC      1536   1-17-87   5:14p
RUN      BAT       128  11-12-84   1:22a
SCROLLCK COM       512   1-01-80  12:03a
SDIR     COM      2304  12-11-83   4:23a
SDIR     DOC      1536  12-11-83   4:22a
SOWINDEX BAS     28672   3-21-84   6:17a
STEERBID BAS      7808   3-12-84   6:16p
TIMEC    COM      1183   1-16-83   3:02p
ULOGO    BAS      1251   2-11-84  10:37a
USERDOCS BAS      3712   1-28-84   1:22p
       23 file(s)     268735 bytes
                       41984 bytes free