Monday, 10 October 2016

Program to edit the record of student database

set talk off
clear
use stude
do while .T.
    clear
    store 0 to rno
    store space(15) to nm
    store space(15) to ct
    store space(1) to gn,opt
    store {} to dt
    @5,5 say "Enter roll no: " get rno pict "999" valid rno>0 error "Roll no >0"
    read
    seek rno
    if not found()
        wait window "Roll no not found"
        loop
    endif
    rno=rollno
    nm=name
    ct=city
    dt=dob
    gn=gender
    @2,2 to 23,80 double
    @5,30 say "Student Data Entry" font "Cambria",16
    @8,3 say repl("=",77)
    @10,10 say "Enter roll no: " get rno pict "999" valid rno>0 error "Roll no should be greater than zero"
    @12,10 say "Enter name: "get nm pict "@!"
    @14,10 say "Enter city: "get ct pict "@!"
    @16,10 say "Enter DOB: " get dt function "E"
    @18,10 say "Enter gender: "get gn pict "!" valid gn="M" or gn="F" error "Gender must be M or F"
    @20,3 say repl("=",77)
    @21,20 say "Do you want to edit more record?" get opt func "!" pict "Y"
    read
 
    replace rollno with rno
    replace name with nm
    replace city with ct
    replace dob with dt
    replace gender with gn
    if opt="N " then
        exit
    endif
enddo
    use
    clear all
set talk on

No comments:

Post a Comment

Convey your thoughts to authors.