Hi there, Im in needing of some help with my code.
print "1. Read from a file."
print "2. Fill out a new staff file."
input "What would you like to do: ",choice$
if choice$ = "1"
Input "What file would you like me to read: ", FileName$
else
endif
if choice$ = "2"
print "This will create a new staff file called NewStaff.txt"
input "Name: ",name$
input "Full name: ",fname$
input "Age: ",age$
input "Location: ",location$
input "Email Address: ",email$
input "Job: ",job$
else
endif
`File writing
IF FILE EXIST("NewStaff.txt") = 1
DELETE FILE "NewStaff.txt"
ENDIF
OPEN TO WRITE 1,"NewStaff.txt"
`Write to file
Write string 1,name$
Write string 1,fname$
Write string 1,age$
Write string 1,location$
Write string 1,email$
Write string 1,job$
` File Loading
If File Exist(FileName$) = 0
Print "That file does not exist!"
else
Endif
Open to read 1,FileName$
Read string 1,name$
Read string 1,fname$
Read string 1,age$
Read string 1,location$
Read string 1,email$
Read string 1,job$
Close File 1
Wait Key
When I run it, I get a runtime error #44 any help? and could someone over look at it and see if theres anything wrong with it. Its my first dbpro code.
=\