179.WAP
that asks a post of the employee and displays his/her records from the
sequential data file “XYZ.REC” having fields Name, Post, Dept and Salary.
OPEN “XYZ.REC” FOR INPUT AS #1
CLS
INPUT “Enter post to be searched”; S$
FLAG=0
WHILE NOT EOF(1)
INPUT #1, N$, P$, D$, S
IF UCASE$(S$)=UCASE$(P$) THEN
PRINT N$, P$, D$, S
FLAG=1
END IF
WEND
IF FLAG=0 THEN PRINT “Data not found”
CLOSE #1
END
No comments:
Post a Comment