0001 ! Requires HP-75, I/O ROM, and text file on disc names "FILE"&2 digit number. 0002 ! See DATADOC for more info. 0003 ! C A Erickson; P O Box 306; Princeton, NJ 08542. 0010 DIM A$[33],A1$[17],A2$[19],A3$[6],A4$[18],A5$[4],A6$[2],L$[80],M$[10] 0011 IF LISTIO$="" THEN BEEP 150 @ DISP "Drive and printer required!" @ GOTO 501 0012 WIDTH 80 @ IF PRINTER$="" THEN PRINTER IS ":D1" 0013 PWIDTH 80 @ MARGIN 80 @ D$=DATE$ @ B$="FILE" @ F=VAL(D$[4,5]) 0014 C=0 @ DISP "Ádd, Óearch, Ìist, or Ñuit ?" @ GOSUB 1000 0015 A=POS("ASLQ",N$)+1 @ ON A GOTO 14,100,200,300,500 0098 ! 0099 ! The module below adds data to a text file on disc. 0100 K=89 @ PUT "¬" @ INPUT "File no. : "; N$ @ IF LEN(N$)=1 THEN N$="0"&N$ 0101 N$=B$&N$ @ RESTORE 900 @ SEEK # 0,F @ READ M$ @ A4$=UPRC$(M$[1,3]) 0102 INPUT "Keyword name : "; A$ @ A$='*'&A$ @ INPUT "Keyword genus : ";A1$ 0103 INPUT "Keyword location : "; A2$ @ INPUT "Keyword state : ","NJ";A3$ 0104 INPUT "Keyword month : ",A4$; A4$ @ INPUT "Keyword year : ",D$[1,2];A5$ 0105 INPUT "Keyword country CC : ","US"; A6$ @ A5$=A5$&A6$ @ DISP "Checking" 0106 N=66 @ L=LEN(A$) @ K=K+1 @ C$=B$&STR$(K) @ COPY ":M1" TO C$ 0107 I=LASTLN?(C$)+1 @ ASSIGN # N TO C$ @ FOR J=1 TO I-1 @ READ # N,J ; L$ 0108 IF A$=L$[1,L] THEN DISP "Species in file" @ PURGE C$ @ GOTO 111 0109 NEXT J @ IF K<93 THEN PURGE C$ @ GOTO 106 0110 BEEP 100 @ DISP "New Species" @ GOSUB 120 @ COPY C$ TO ":M1" @ PURGE C$ 0111 COPY ":M1" TO N$ @ N=54 @ ASSIGN # N TO N$ @ I=LASTLN?(N$)+1 @ GOSUB 120 0112 PUT "Œ" @ INPUT "2nd line place : "; A$ @ INPUT "2nd line weather : ";W$ 0113 INPUT "2nd line temp (C) : "; A1$ @ INPUT "2nd line time : ";A3$ 0114 INPUT "2nd line date : ",D$[7,8]&' '&M$&" 19"&D$[1,2]; A4$ @ A$=A$&", " 0115 W$=W$&", " @ A1$=A1$&"deg, " @ A3$=A3$&", " @ A4$=A4$&"." @ I=I+1 0116 L$=A$&W$&A1$&A3$&A4$ @ PRINT # N,I ; L$ @ FOR J=1 TO 99 0117 I=I+1 @ DISP "Data line";J; @ INPUT L$ @ IF L$="" THEN EXIT J 0118 PRINT # N,I ; L$ @ NEXT J @ CLEAR ASSIGN# @ DISP "Saving file" 0119 COPY N$ TO ":M1" @ PURGE N$ @ GOTO 14 0120 PRINT # N,I USING "33A,17A,19A,3A,4A,4A" ; A$,A1$,A2$,A3$,A4$,A5$ 0121 RETURN 0197 ! 0198 ! The module below searches text files on disc for mention of the specified 0199 ! keywords and prints the entries. 0200 P=70 @ PUT "¬" @ INPUT "File no. range : ";R,S 0201 DISP "Search may be made by state, country, or neither but not both." 0202 INPUT "For state search, enter code SS:"; X$ @ X=X$#"" @ IF X THEN 204 0203 INPUT "For country search, enter code CC:"; X$ @ X=X$#"" @ IF X THEN P=79 0204 INPUT "Keywords (two max) : "; A$,A1$ @ Y=A1$="" @ PUT "Œ" 0205 INPUT "Print keywords only ? Y/N ","Y"; Z$ @ DISP 0206 FOR K=R TO S @ N=1 @ N$=STR$(K) @ IF LEN(N$)=1 THEN N$="0"&N$ 0207 N$=B$&N$ @ COPY ":M1" TO N$ @ ASSIGN # 49 TO N$ @ ON ERROR GOTO 214 0208 SEARCH # 49,N ; A$ @ I=LINE#(49) @ READ # 49,I ; L$ @ N=I+3 0209 X1=X$=L$[P,P+1] @ X2=Y OR POS(L$,A1$) 0210 IF (NOT X OR X1) AND X2 THEN PRINT L$[2] @ C=C+1 ELSE 208 0211 IF UPRC$(Z$)="Y" THEN 208 0212 FOR J=I+1 TO INF @ READ # 49,J ; L$ @ N=J @ IF L$[1,1]="*" THEN EXIT J 0213 PRINT L$ @ NEXT J @ PRINT @ GOTO 208 0214 OFF ERROR @ CLEAR ASSIGN# @ PURGE N$ @ NEXT K 0215 PRINT C;"Match(es); No more data." @ GOTO 14 0297 ! 0298 ! The module below makes a list in a text file of all species in the 0299 ! specified disc files with the matching keywords. 0300 PUT "¬" @ INPUT "Keywords (two max) : "; A$,A1$ @ L=LEN(A$) 0301 PUT "Œ" @ C$=A$ @ IF C$[L]=" " THEN C$=C$[1,L-1] @ L=L-1 0302 INPUT "File no. range : "; R,S @ IF C$[1,1]=" " THEN C$=C$[2] @ L=L-1 0303 L=MIN(L,5) @ C$="BRD"&C$[1,L] @ DISP C$ @ ASSIGN # 58 TO C$,TEXT 0304 C=LASTLN?(C$) @ FOR I=R TO S @ J=1 @ N$=STR$(I) @ IF I<10 THEN N$="0"&N$ 0305 N$=B$&N$ @ COPY ":M1" TO N$ @ ASSIGN # 32 TO N$ @ DISP "Searching "&N$ 0306 K=J @ ON ERROR RETURN 0307 SEARCH # 32,J ; A$ @ OFF ERROR @ L=LINE#(32) @ READ # 32,L ; L$ @ J=L+3 0308 IF J=K THEN 314 0309 IF NOT FIND(A1$,L$,"",1) THEN 306 0310 L1$=L$[2,33] @ L1$=RTRIM$(" ",L1$) @ ON ERROR RETURN 0311 SEARCH # 58,1 ; L1$ @ OFF ERROR @ GOTO 306 0312 C=C+1 @ PRINT # 58,C ; L1$ 0313 IF MEM>200 THEN 306 ELSE DISP "Out of Memory "; @ PURGE N$ @ EXIT I 0314 PURGE N$ @ NEXT I @ PRINT C;"Matches" @ CLEAR ASSIGN# @ GOTO 14 0499 ! 0500 DISP " Leaving program" 0501 CLEAR VARS @ END 0899 ! 0900 DATA January,February,March,April,May,June,July,August,September,October 0901 DATA November,December 0999 ! 1000 N$=UPRC$(KEY$) @ IF N$="" THEN 1000 ELSE RETURN