Saturday, December 28, 2019
6. WAP to delete some records from “RECORD.dat” file where computer ask user to enter the record, which is to be deleted. (HINT : name, address, and telephone number).
Ans:-
CLS
OPEN “RECORD.DAT” FOR INPUT AS #1
OPEN “NEWRECORD.DAT” FOR OUTPUT AS #2
INPUT “Enter name which is to be deleted”; D$
WHILE NOT EOF(1)
INPUT #1, N$, A$, T
IF UCASE$(D$)<>UCASE$(N$) THEN
WRITE #2, N$, A$, T
ELSE
PRINT “Deleted data=”; N$, A$, T#
END IF
WEND
CLOSE #1, #2
KILL “RESULT.DAT”
NAME “NEWRESULT.DAT” AS “RESULT.DAT”
END
Subscribe to:
Post Comments (Atom)
File Handling
Introduction:- Data are used in all the programs for retrieving information. In QBASIC you can store data in a separate file called a da...

No comments:
Post a Comment