10 ! PROGRAM TO GENERATE DATAPLOT SOURCE CODE FOR DOING GRAPHS FOR
20 ! PRESENTATIONS
25 ! MODIFIED FOR INDIRECT FILE INPUT RATHER THAN TERMINAL
30 DIM AN$[1],LA$[60]V,NA$[32]V
40 PRINT "PROGRAM TO GENERATE DATAPLOT (FORTRAN) SOURCE CODE"
41 PRINT "YOU SHOULD HAVE READ THE DATAPLOT USERS GUIDE FIRST"
42 PRINT "NOTE THAT:"
43 PRINT
44 PRINT "CHARACTER STRING LOCATIONS, AXIS LENGTH ARE IN INCHES"
45 PRINT "VECTOR AND POINT LOCATINS ARE ACTUAL DATA"
50 INPUT "NAME OF INDIRECT COMMAND FILE ";NA$
52 OPEN #6,NA$+"/RO"
53 IF END #6 THEN 6000
60 INPUT #6, NA$
61 PRINT "NAME = ";NA$
62 OPEN #3, NA$+".FOR/WR"
70 INPUT #6, WS
71 PRINT "SIZE = ";WS
80 PRINT #3, "      DIMENSION IWA("+FRMT$(WS,5)+")"
85 PRINT #3, "      DIMENSION X(100),Y(100)"
86 PRINT #3, "  888 FORMAT(F6.2,F6.2)"
87 ND=1
90 PRINT #3, "      CALL VOPEN (IWA,"+FRMT$(WS,5)+")"
91 INPUT #6, XO,YO
92 PRINT "XO,YO = ";XO,YO
93 INPUT #6, XI,YI
94 PRINT "XI,YI = ";XI,YI
100 ! GET OPTION
110 INPUT #6, A
111 PRINT "OPTION = ";A
120 ON A GOTO 1000,2000,3000,4000,5000,6000
1000 ! DO VECTOR (SINGLE LINE BETWEEN TWO POINTS)
1010 INPUT #6, X1,Y1,X2,Y2
1011 X1=(X1-XO)/XI+1
1012 Y1=(Y1-YO)/YI+1
1013 X2=(X2-XO)/XI+1
1014 Y2=(Y2-YO)/YI+1
1020 PRINT #3, "      CALL VECTOR("+FRMT$(X1,5,2)+","+FRMT$(Y1,5,2)+","+FRMT$(X2,5,2)+","+FRMT$(Y2,5,2)+")"
1030 GOTO 100
2000 ! PLOT CHARACTER STRING
2010 INPUT #6, X,Y
2020 INPUT #6, LA$
2021 NC=LEN(LA$)
2040 INPUT #6, OX
2050 PRINT #3, "      CALL CHARA("+FRMT$(X,5,2)+","+FRMT$(Y,5,2)+",";
2051 PRINT #3, FRMT$(NC,2)+"H"+LA$+","+FRMT$(OX,1)+","+FRMT$(NC,2)+",-1)"
2060 GOTO 100
3000 ! PLOT MULTIPLE POINTS
3010 INPUT #6, NP
3020 OPEN #4,"DATA"+FRMT$(ND,1)+".DAT/WR"
3030 FOR I=1 TO NP
3040 INPUT #6, X,Y
3041 X=(X-XO)/XI+1
3042 Y=(Y-YO)/YI+1
3050 PRINT #4, FRMT$(X,6,2);FRMT$(Y,6,2)
3060 NEXT I
3070 CLOSE 4
3080 PRINT #3, "      CALL ASSIGN (3,'DATA"+FRMT$(ND,1)+".DAT',9)"
3090 PRINT #3, "      DO "+FRMT$(ND,1)+",I=1,"+FRMT$(NP,2)
3100 PRINT #3, "      READ (3,888) X(I),Y(I)"
3110 PRINT #3, "    "+FRMT$(ND,1)+" CONTINUE"
3111 ND=ND+1
3120 PRINT #3, "      CALL CLOSE(3)"
3130 INPUT #6, SY
3140 INPUT #6, DS
3150 PRINT #3, "      CALL FDATA(X,Y,"+FRMT$(SY,2)+","+FRMT$(NP,2)+",";
3151 PRINT #3, FRMT$(DS,2)+",0.0,1.0,0.0,1.0)"
3160 GOTO 100
4000 ! PLOT SINGLE POINT
4010 INPUT #6, X,Y
4011 X=(X-XO)/XI+1
4012 Y=(Y-YO)/YI+1
4020 INPUT #6, SY
4030 PRINT #3, "      CALL SYMBL("+FRMT$(X,5,2)+","+FRMT$(Y,5,2)+","+FRMT$(SY,2)+")"
4040 GOTO 100
5000 ! PLOT AXIS
5010 INPUT #6, AL
5020 INPUT #6, AO
5030 INPUT #6, LA$
5040 LL=LEN(LA$)
5050 PRINT #3, "      CALL FAXIS(1.0,1.0,"+FRMT$(AL,4,1)+",";
5051 PRINT #3, FRMT$(AO,1)+","+FRMT$(LL,2)+"H"+LA$+","+FRMT$(LL,2)+")"
5052 PRINT #3, "      CALL LABEL(1.0,1.0,"+FRMT$(AL,4,1)+",";
5053 PRINT #3, FRMT$(AO,1)+",";
5054 IF AO=0 THEN PRINT #3, FRMT$(XO,6,3)+","+FRMT$(XI,6,3)+")"
5055 IF AO=1 THEN PRINT #3, FRMT$(YO,6,3)+","+FRMT$(YI,6,3)+")"
5060 GOTO 100
6000 ! CLOSE PLOT
6005 INPUT #6, NC
6007 IF NC>1 THEN PRINT #3, "      CALL SETCOP("+FRMT$(NC,1)+")"
6010 PRINT #3, "      CALL VCLOSE(I)"
6020 PRINT #3, "      PRINT (5,999) I"
6030 PRINT #3, "  999 FORMAT(1H ,I6)"
6035 PRINT #3, "      END"
6040 CLOSE 3
6050 OPEN #3, NA$+".CMD/WR"
6060 PRINT #3, NA$+"="+NA$
6070 PRINT #3, "LB:[1,10]DATAPLF4P.OLB/LB"
6080 PRINT #3, "LB:[1,1]F4POTS.OLB/LB"
6090 PRINT #3, "/"
6100 PRINT #3, "LIBR=F4PRES:RO"
6110 PRINT #3, "//"
6120 EXIT
