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.
sub addfines (library as libraryfines)
anyways heres what i got if anyone can point out where it needs to be defined.
[code]
CLS
TYPE libraryfine
person AS STRING * 25
title AS STRING * 25
book AS INTEGER
days AS INTEGER
END TYPE
DIM library AS libraryfine
OPEN "LIBRARY.DAT" FOR RANDOM AS #1 LEN = LEN(library)
'***** is this not where its defined?

^*****
DO UNTIL choice = 3
CLS
PRINT "School Library Fine Database"
PRINT
PRINT "1. Enter new fines."
PRINT "2. Display student fines."
PRINT "3. Finished "
PRINT
INPUT "Enter choice (1-3)", choice
SELECT CASE choice
CASE 1
CASE 2
CALL displayfines(library)
CASE 3
CLOSE #1
PRINT "Thank you"
CASE ELSE
PRINT
PRINT "Answer must be 1, 2 or 3."
END SELECT
LOOP
CLOSE #1
SUB addfines (library AS libraryfines)
CLS
INPUT "Enter Student's Name: ", library.person
INPUT "Enter Book's Title: ", library.title
INPUT "Enter Type of Book (1 or 2): ", library.book
INPUT "Enter Days Overdue: ", library.days
PUT #1, 1, person
PUT #1, 2, title
PUT #1, 3, book
PUT #1, 4, days
END SUB
SUB displayfine (library AS libraryfine)
INPUT "Enter Student's name: ", person
GET #1, 1, person
GET #1, 2, title
GET #1, 3, book
GET #1, 4, days
IF book = 1 THEN
total = .25 * days
ELSE
total = .4 * days
END IF
PRINT "Name"; TAB(5); "Book Title"; TAB(5); "Book Type"; TAB(5); "Days Late"
PRINT fines.person; fines.title; fines.book; fines.days
PRINT
PRINT "Total Amount due: $"; total
PRINT
END SUB