Page 1 of 1

Help with OPEN/WRITE/CLOSE statement

Posted: Sun Sep 23, 2007 3:58 pm
by Sinuvoid
I keep getting an error that says "type mismatch" but everythings perfect...someone wanna look at my code and figure it out?

Code: Select all

CLS
' menu
PRINT "(2) ADD"
PRINT "(1) SEARCH"
'my INKEY statment
kp$ = INKEY$
IF kp$ = "2" THEN GOTO Addp
IF kp$ = "1" THEN GOTO searchp
'This is the end of the menu

'This adds people to the database
addp:
CLS

INPUT "Age:", age$
INPUT "Name:", name$
INPUT "Personality:", per$
INPUT "Pasttimes:", past$
INPUT "Comment:", com$

OPEN database.txt FOR OUTPUT AS #1
WRITE #1, age$, name$
WRITE #1, per$
WRITE #1, past$
WRITE #1, com$
CLOSE #1


searchp:

[code/]

by the way its not done =)

Posted: Sun Sep 23, 2007 4:43 pm
by Lachie Dazdarian
Just make this change:

OPEN "database.txt" FOR OUTPUT AS #1

Posted: Sun Sep 23, 2007 4:47 pm
by Sinuvoid
lmao, i guess ive solved and redid this problem like 5 times cause i remember someone sayin that =)

Posted: Sun Sep 23, 2007 8:02 pm
by Mentat
Lachie Dazdarian wrote:Just make this change:

OPEN "database.txt" FOR OUTPUT AS #1
:lol:
That happened to me. Just add quote marks.