'=========================================================================== ' Subject: DAILY JOURNAL RECORDER Date: 06-24-97 (21:26) ' Author: Michael G. Stewart Code: QB, QBasic, PDS ' Origin: mikegs@juno.com Packet: MISC.ABC '=========================================================================== DECLARE SUB newentry () DECLARE SUB center (row!, text$) DECLARE SUB sparklepause () DECLARE SUB openfile () DECLARE SUB newfile () DECLARE SUB Intro () CLS Intro openfile CLOSE #1 END errorhandler: SELECT CASE ERR CASE 53 PRINT "QJournal File Not Found. (*.jrn)" INPUT "Create a New One? ", e53$ LET e53$ = UCASE$(e53$) IF e53$ = "Y" THEN newfile END RESUME END SELECT ends: KEY(10) OFF CLOSE #1 END SUB center (row, text$) LOCATE row, 41 - LEN(text$) / 2 PRINT text$; END SUB SUB Intro COLOR 9, 0 center 2, "Q B a s i c" COLOR 12, 0 LOCATE 2, 1 PRINT TAB(36); "Q" COLOR 10, 0 center 4, "Q J O U R N A L" COLOR 12, 0 LOCATE 4, 1 COLOR 13, 0 center 10, "QJournal: A Journal Recording Program Written in QBasic" center 11, "Written by: Mike Stewart" COLOR 9, 0 center 14, "MS-DOS Qbasic" center 15, "Version 1.1" center 16, "Copyright (C) Microsoft Corporation, 1987-1992" COLOR 10, 0 center 18, "QJournal" center 19, "Version 1.0" center 20, "Copyright (C) Granite Hill Computer Systems, 1997" center 21, "Public Domain" COLOR 27, 0 center 23, "Press Any Key To Begin" sparklepause END SUB SUB newentry CLS PRINT "When you are done, press F10 to save and exit." COLOR 15, 0 PRINT "File: "; fln$ PRINT "Date: "; DATE$ PRINT #1, "Date: "; DATE$ PRINT #1, STRING$(80, 196) PRINT STRING$(80, 196) ON KEY(10) GOSUB ends KEY(10) ON p = 4 DO LET p = p + 1 LOCATE p, 2 LINE INPUT "", m$ PRINT #1, m$ LOOP END SUB SUB newfile CLS INPUT "First Name: ", fsn$ LET fsna$ = MID$(fsn$, 1, 1) LET fsnb$ = MID$(fsn$, 2) fsna$ = UCASE$(fsna$) fsnb$ = LCASE$(fsnb$) LET fsn$ = fsna$ + fsnb$ CLS PRINT "Hello "; fsn$; PRINT "! This is the QJournal Setup Utility." PRINT "We need to know some information from you." PRINT "Fill it in below, press ENTER to go to the next line." COLOR 15, 0 PRINT "PERSONAL INFORMATION:" PRINT "First Name: "; fsn$ INPUT "Middle Name: ", mn$ INPUT "Last Name: ", ln$ INPUT "Date of Birth: ", db$ INPUT "Password: ", p$ n$ = fsn$ + " " + mn$ + " " + ln$ fln$ = MID$(n$, 1, 7) + ".jrn" LOCATE 9, 11: PRINT SPACE$(69) PRINT "Filename: "; fln$ OPEN fln$ FOR OUTPUT AS #1 PRINT #1, p$ PRINT #1, "Name: "; n$ PRINT #1, "Birthdate: "; db$ PRINT "FAMILY INFORMATION:" INPUT "Father's Name: ", fatn$ INPUT "Mother's Name: ", motn$ PRINT #1, "Father: "; fatn$ PRINT #1, "Mother: "; motn$ INPUT "Number of Brothers: ", nb FOR a = 1 TO nb STEP 1 IF nb = 0 THEN EXIT FOR PRINT "Brother #"; a; : INPUT "'s Name: ", bn$ PRINT #1, "Brother #"; a; ":"; bn$ NEXT a INPUT "Number of Sisters: ", ns FOR a = 1 TO ns STEP 1 IF nb = 0 THEN EXIT FOR PRINT "Sister #"; a; : INPUT "'s Name: ", sn$ PRINT #1, "Sister #"; a; ":"; sn$ NEXT a CLOSE #1 OPEN fln$ FOR INPUT AS #1 CLS COLOR 10, 0 center 1, "Entries in your file:" DO WHILE NOT EOF(1) LINE INPUT #1, rec$ PRINT rec$ LOOP CLOSE #1 OPEN fln$ FOR APPEND AS #1 CLS COLOR 7, 0 PRINT "O.K. "; fsn$; ", We are ready to make your first entry." PRINT "It will automaticly display the filename and the date at the top" PRINT "of the entry. When typing, to move to the next line, hit enter," PRINT "and the line you just finished will be saved automaticly." PRINT "when you are done, print 'End of Entry' on one line, to save and exit." COLOR 15, 0 PRINT "File: "; fln$ PRINT "Date: "; DATE$ PRINT #1, "Date: "; DATE$ PRINT #1, STRING$(80, 196) PRINT STRING$(80, 196) p = 8 DO LET p = p + 1 LOCATE p, 2 LINE INPUT "", m$ IF m$ = "End of Entry" THEN EXIT DO PRINT #1, m$ LOOP COLOR 7, 0 PRINT "Now that wasn't too hard was it." PRINT "Just remember to do this every day." COLOR 11 PRINT "QJournal (C) 1997 Mike Stewart." CLOSE #1 END END SUB SUB openfile CLS COLOR 7, 0 ON ERROR GOTO errorhandler FILES "*.jrn" INPUT "C:\DOS>", o$ LET ext$ = RIGHT$(o$, 4) ext$ = UCASE$(ext$) IF ext$ <> ".JRN" THEN LET o$ = o$ + ".jrn" OPEN o$ FOR INPUT AS #1 ON ERROR GOTO 0 INPUT "Password: ", p$ LINE INPUT #1, fp$ IF p$ <> fp$ THEN END CLOSE #1 OPEN o$ FOR APPEND AS #1 newentry CLOSE #1 COLOR 11 PRINT "QJournal (C) 1997 Mike Stewart." END SUB SUB sparklepause COLOR 11, 0 a$ = "* * * * * * * * * * * * * * * * * " WHILE INKEY$ <> "": WEND 'Clear keyboard buffer WHILE INKEY$ = "" FOR a = 1 TO 5 LOCATE 1, 1 'print horizontal sparkles PRINT MID$(a$, a, 80); LOCATE 22, 1 PRINT MID$(a$, 6 - a, 80); FOR b = 2 TO 21 'Print Vertical sparkles c = (a + b) MOD 5 IF c = 1 THEN LOCATE b, 80 PRINT "*"; LOCATE 23 - b, 1 PRINT "*"; ELSE LOCATE b, 80 PRINT " "; LOCATE 23 - b, 1 PRINT " "; END IF NEXT b NEXT a WEND END SUB