error message "type not defined"

liunx

Guest
some more basic fun. i needed to write 2 programs one using a random access file for a library to calculate fines and another to display them. im putting the two together just because its really not that hard but i keep getting an error saying "type not defined" in my sub function. <br />sub addfines (library as libraryfines) <img src="http://static.dreamincode.net/forums/style_emoticons/default/blink.gif" style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" /> <br /><br />anyways heres what i got if anyone can point out where it needs to be defined.<br /><br />
Code:
<br />CLS<br /><br />TYPE libraryfine<br />        person AS STRING * 25<br />        title AS STRING * 25<br />        book AS INTEGER<br />        days AS INTEGER<br />END TYPE<br />DIM library AS libraryfine<br /><br />OPEN "LIBRARY.DAT" FOR RANDOM AS #1 LEN = LEN(library)<br />'***** is this not where its defined? <img src="http://static.dreamincode.net/forums/style_emoticons/default/whatsthat.gif" style="vertical-align:middle" emoid="^^" border="0" alt="whatsthat.gif" />^*****<br /><br />DO UNTIL choice = 3<br />        CLS<br />        PRINT "School Library Fine Database"<br />        PRINT<br />        PRINT "1. Enter new fines."<br />        PRINT "2. Display student fines."<br />        PRINT "3. Finished "<br />        PRINT<br /><br />        INPUT "Enter choice (1-3)", choice<br /><br />SELECT CASE choice<br />        CASE 1<br />        CASE 2<br />                CALL displayfines(library)<br />        CASE 3<br />                CLOSE #1<br />                PRINT "Thank you"<br />        CASE ELSE<br />                PRINT<br />                PRINT "Answer must be 1, 2 or 3."<br />END SELECT<br />LOOP<br />CLOSE #1<br /><br /><br /><br /><br /><br />SUB addfines (library AS libraryfines)<br /><br />CLS<br />INPUT "Enter Student's Name: ", library.person<br />INPUT "Enter Book's Title: ", library.title<br />INPUT "Enter Type of Book (1 or 2): ", library.book<br />INPUT "Enter Days Overdue: ", library.days<br /><br />PUT #1, 1, person<br />PUT #1, 2, title<br />PUT #1, 3, book<br />PUT #1, 4, days<br /><br /><br />END SUB<br /><br /><br /><br />SUB displayfine (library AS libraryfine)<br /><br />INPUT "Enter Student's name: ", person<br />GET #1, 1, person<br />GET #1, 2, title<br />GET #1, 3, book<br />GET #1, 4, days<br /><br />IF book = 1 THEN<br />total = .25 * days<br />ELSE<br />total = .4 * days<br />END IF<br /><br />PRINT "Name"; TAB(5); "Book Title"; TAB(5); "Book Type"; TAB(5); "Days Late"<br />PRINT fines.person; fines.title; fines.book; fines.days<br />PRINT<br />PRINT "Total Amount due: $"; total<br />PRINT<br /><br />END SUB<br />
</div>
 
Back
Top