home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
dbaseii
/
tdas.ark
/
STUDENT4.PRG
< prev
next >
Wrap
Text File
|
1986-08-24
|
3KB
|
148 lines
*******************************************************************************
* This program deletes a student from the "active" file, but for nostalgia, *
* insurance and possible re-use at some later date, places that student *
* in the ex-student file. *
*******************************************************************************
SET Talk OFF
STORE T TO delerec
STORE T TO repeat
STORE F TO drec,query2
STORE " " to Mname
ERASE
DO WHILE delerec
DO WHILE repeat
USE Student
@ 3,30 SAY "YOUR COMPANY'S NAME"
@ 5,9 SAY "-=>This program will delete a student from the active file<=-"
@ 13,1 SAY "Enter the student's last name OR the acct. number";
GET Mname
READ NOUPDATE
IF Mname = " "
STORE F TO delerec
STORE F TO repeat
STORE F to finish
LOOP
ENDIF
IF VAL(Mname)>500
SET Index TO Id,Lname
STORE $(Mname,1,4) to Findstud
ELSE
SET Index TO Lname,Id
STORE TRIM(Mname) to Findstud
ENDIF
FIND &Findstud
IF #=0
@ 22,0 SAY Findstud+" is not in the student file"
LOOP
ENDIF
@ 22,0
IF #>0
STORE # to Placemark
IF .NOT. Acct:num=Findstud .OR. .NOT.Lname=Findstud
SKIP
IF Lname=Findstud .AND..NOT.EOF
ERASE
@ 1,1 SAY "Ahem! It would appear we have more than one "+Findstud
SKIP -1
?
DISPLAY Fname,Lname WHILE Lname=Findstud
?
INPUT "Enter the number from the left column, or enter 0 to abort";
to Placemark
ENDIF
ENDIF
IF Placemark >0
GO Placemark
SET FORMAT TO Student4
READ NOUPDATE
SET Format TO Screen
INPUT "Delete this record (Y/N)?" to Query
IF Query
COPY NEXT 1 to Tfile
DELETE
ERASE
ENDIF
ENDIF
*
USE XStudent
SET Index TO Xlname,Xid
Append from Tfile
STORE " " to Mname
ERASE
*
INPUT "Are there more students to delete from the active file (Y/N)?";
TO repeat
IF repeat
ERASE
LOOP
USE STUDENT
SET INDEX to Lname,ID
STORE " " to Placemark
STORE " " to Findstud
ELSE
STORE T TO finish
ENDIF
ENDDO
*
IF finish
ERASE
USE Student INDEX Lname,ID
DISPLAY OFF TRIM(Fname),Lname for *
?
INPUT "Last Shot: Should I complete deleting the above students (Y/N)?";
TO Query2
*
IF Query2
ERASE
@ 1,0
@ 2,0
@ 3,0
@ 4,0
@ 5,0
@ 6,0
@ 10,5 SAY "Relax, chum. This will take about 30-45 seconds"
@ 12,8 SAY "...Then you'll be flipped back to the main menu."
PACK
REINDEX
ELSE
RECALL ALL
ENDIF
ERASE
ENDIF
STORE F to Delerec
RELEASE Editrec,Mname,Placemark,Query,Query2,repeat,finish
DELETE FILE Tfile
SET Talk ON
ENDDO
USE
RETURN
* EOF
INDEX to Lname,ID
STORE " " to Placemark
STORE " " to Findstud
ELSE
STORE T TO finish
ENDIF
ENDDO
*
IF finish
ERASE
USE Student INDEX Lname,ID
DISPLAY OFF TRIM(Fname),Lname for *