1 COMMON A, AL, B, BASEONLY, C, C$, C1, CAT$, CC, CKT$, D, D$, DD, DIA, DIMN$, DMS, E, EO, EX$, F, F$, FD, FF, FQ, FRQ, G$, GO$, I, I$, L, LATLONG, LD, LL, LN, LS, LW, LX, MAX, MENU, MIN, MX, N, NN, NT, OV, P, PI, PROG$, Q, QQ, QU, R, RA, RC, T, T$, U, U$, UH, UL$, V$, VC, W, WHIP, WIRD, WW, X, X$, X1, XS, Z$, ZP, ZS
5 'OMMON EX$
10 'CYL : 5 DEC 85  rev. 22 MAR 2000
20 IF EX$=""THEN EX$="exit"
30 
40 CLS:KEY OFF
50 PI=3.141592
60 U$="###,###.###"
70 UL$=STRING$(80,205)
80 GOTO 130
90 '
100 C1=10:C2=10:C3=40:GOSUB 110:LOCATE 10,41:RETURN
110 FOR U=C1 TO C2:LOCATE U,C3:PRINT STRING$(40,32):NEXT U:RETURN
120 '
130 '.....start
140 COLOR 11,1,4
150 PRINT " AIR & HYDRAULIC CYLINDERS";TAB(57);;"by George Murphy VE3ERP ";
160 COLOR 4,0: PRINT STRING$(80,"ß");
170 COLOR 7,0
180 PRINT TAB(24);"  Press letter in ( ) to select program";
190 PRINT UL$;
200 PRINT TAB(24);"  (a)  Run CYLINDER program";
210 PRINT TAB(24);"  (b)  Exit";
220 Z$=INKEY$
230 IF Z$="a"OR Z$="A"THEN CLS:GOTO 280
240 IF Z$="b"OR Z$="B"THEN CLS:CHAIN"mechmenu"
250 ON ERROR GOTO 270
260 GOTO 220
270 CLS:END
280 '.....start
290 COLOR 7,0,0:PRINT "AIR / HYDRAULIC CYLINDERS SPECS.";:PRINT
300 LOCATE 1,41
310 PRINT "ENTER factor if known or";
320 LOCATE 2,41
330 PRINT "Press [ENTER] if unknown";
340 LOCATE 10,41
350 IF P THEN 370
360 INPUT "P.S.I. ..................";P:GOSUB 100:GOSUB 470
370 IF A+I THEN 390
380 INPUT "Cylinder diameter .......";C:A=PI*(C/2)^2:GOSUB 100:GOSUB 470
390 IF O+I THEN 420
400 INPUT "Lbs. Push ...............";O:GOSUB 100:GOSUB 470
410 C1=4:C2=5:C3=41:GOSUB 100:GOTO 340
420 IF D<>0 AND I<=0 THEN 440
430 INPUT "Rod diameter ............";R:D=PI*(R/2)^2:GOSUB 100:GOSUB 470
440 IF I+O THEN 460
450 INPUT "Lbs. Pull ...............";I:GOSUB 100:GOSUB 470
460 GOTO 340
470 FOR Y=1 TO 2
480 IF A*D THEN B=A-D
490 IF B>=0 THEN 540
500 LOCATE 4,43:PRINT "ROD BIGGER THAN CYLINDER !";
510 LOCATE 5,41:PRINT "( Press any key to continue )";
520 Z$=INKEY$:IF Z$<>""THEN C1=4:C2=5:C3=41:GOTO 100:GOTO 340
530 GOTO 520
540 IF A*B THEN D=A-B
550 IF B*D THEN A=B+D
560 IF A*P THEN O=A*P
570 IF A*O THEN P=O/A
580 IF A=0 AND (P*O>0) THEN A=O/P
590 IF B*P THEN I=B*P
600 IF B*I THEN P=I/B
610 IF B=0 AND (P*I>0) THEN B=I/P
620 IF A*P*O THEN 640
630 NEXT Y:RETURN
640 Z=2*SQR(A/PI)
650 LOCATE 8,41
660 IF W=Z THEN Y$=""ELSE Y$="Theoretical "
670 PRINT Y$;;"Cyl.dia.(in.)=";USING U$;Z
680 LOCATE 10,41
690 IF W=Z THEN 740
700 INPUT "ENTER: Next standard dia.=";W
710 C1=8:C2=10:C3=41:GOSUB 110
720 A=PI*(W/2)^2:B=0:D=0:I=0:GOSUB 470
730 PRINT I,O:STOP
740 C=Z
750 IF B THEN 810 ELSE LOCATE 5,41:PRINT "Do you want pull lbs.? (y/n)";
760 Z$=INKEY$
770 IF Z$="y"OR Z$="Y"THEN 800
780 IF Z$="n"OR Z$="N"THEN C1=5:C2=5:C3=41:GOSUB 110:GOTO 810
790 GOTO 760
800 GOSUB 100:C1=5:C2=5:C3=41:GOSUB 110:I=9.999999E-07:LOCATE 10,41:GOTO 430
810 LOCATE 5,41
820 PRINT "Do you want displacement? (y/n)";
830 Z$=INKEY$
840 IF Z$="y"OR Z$="Y"THEN 870
850 IF Z$="n"OR Z$="N"THEN C1=5:C2=5:C3=41:GOSUB 110:GOTO 880
860 GOTO 830
870 LOCATE 10,41:INPUT "Stroke (in.) ............";S:V=S*A
880 C1=4:C2=10:C3=41:GOSUB 110:LOCATE 4,1
890 PRINT "Cylinder diameter (in.) ...";USING U$;C
900 IF D=0 THEN 930
910 R=2*SQR(D/PI)
920 PRINT "Rod diameter (in.) ........";USING U$;R
930 PRINT "Lbs. Push .................";USING U$;O
940 IF I<9.999999E-06 THEN 960
950 PRINT "Lbs. Pull .................";USING U$;I
960 PRINT "Pressure (P.S.I.) .........";USING U$;P
970 IF S=0 THEN 1000
980 PRINT "Stroke (in.) ..............";USING U$;S
990 PRINT "Displacement (cu.in.) .....";USING U$;V
1000 C1=1:C2=2:C3=41:GOSUB 110
1010 GOSUB 1030:CLS:GOTO 130
1020 '
1030 'PRT
1040 KEY OFF:GOSUB 1110:LOCATE 25,5:COLOR 0,2
1050 PRINT " Send this page to:(1)Printer Queue? (2)Printout? ";
1060 PRINT "(3)Next page? (1/2/3)";:COLOR 7,0
1070 Z$=INKEY$:IF Z$<"1"OR Z$>"3"THEN 1070 ELSE GOSUB 1110
1080 IF Z$="3"THEN RETURN
1090 FOR I%=1 TO 24:FOR J%=1 TO 80:LPRINT CHR$(SCREEN(I%,J%));:NEXT J%:NEXT I%
1100 IF Z$="2"THEN LPRINT CHR$(12) ELSE 1040
1110 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
