home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / dbaseii / tdas.ark / STUDENT3.PRG < prev    next >
Text File  |  1986-08-24  |  3KB  |  130 lines

  1. *******************************************************************************
  2. *       This program plucks a student from the alumni or inactive file        *
  3. *       and restores him/her to the active student file.                      *
  4. *******************************************************************************
  5. SET Talk OFF
  6. STORE T TO delerec
  7. STORE T TO Repeat
  8. STORE F to drec,query2
  9. STORE "               " to Mname
  10. ERASE
  11. *
  12. DO WHILE Delerec
  13. DO WHILE Repeat
  14. USE Xstudent
  15. @ 3,27 SAY "YOUR COMPANY'S EX-STUDENTS"
  16. @ 5,2 SAY "**==>Let me guide you through restoring a student to the active;
  17.   file:<==**"
  18. @ 13,1 SAY "Enter the student's last name OR the account number";
  19.   GET Mname
  20. READ NOUPDATE
  21.   IF Mname = "               "
  22.   STORE F TO Delerec
  23.   STORE F TO Repeat
  24.   STORE F TO Finish
  25.   LOOP
  26.   ENDIF
  27.  
  28. IF VAL (Mname)>500
  29.   SET Index TO Xid,Xlname
  30.   STORE $(Mname,1,4) to Findstud
  31.  
  32. ELSE
  33.   SET Index TO Xlname,Xid
  34.   STORE TRIM(Mname) to Findstud
  35. ENDIF
  36.  
  37. Find &Findstud
  38.  
  39. IF #=0
  40.   @ 22,0 say Findstud+" is not in the ex-student file"
  41.   LOOP
  42. ENDIF
  43.  
  44. IF #>0
  45.   STORE # to Placemark
  46.  
  47. IF .NOT. Acct:num=Findstud .OR. .NOT. Lname=Findstud
  48.   SKIP
  49.     IF Lname=Findstud .AND..NOT.EOF
  50.       ERASE
  51.       @ 1,1 SAY "Goodness me!  It would appear we have more than one ";
  52.       +Findstud
  53.       SKIP -1
  54.       ?
  55.       DISPLAY Fname,Lname WHILE Lname=Findstud
  56.       ?
  57.       INPUT "Enter the number from the left column, or enter (numerical);
  58.       0 to abort" to Placemark
  59.     ENDIF
  60. ENDIF
  61.  
  62. If Placemark >0
  63.   GO Placemark
  64.   SET format TO Student4
  65.   READ NOUPDATE
  66.  
  67.   SET format TO Screen
  68.   INPUT 'Put this student back in the "Active" file (Y/N)?' to Query
  69.  
  70.   IF Query
  71.     COPY NEXT 1 to Tfile    DELETE
  72.     ERASE
  73.   ENDIF
  74. ENDIF
  75. *
  76. USE Student
  77. SET Index TO Lname,ID
  78. APPEND From Tfile
  79. STORE "               " to Mname
  80. ERASE
  81. *
  82. INPUT "Are there more students to restore to the active file (Y/N)?";
  83. TO Repeat
  84.   IF Repeat
  85.     ERASE
  86.     LOOP
  87.     USE Xstudent
  88.     SET Index TO Xlname,Xid
  89.     STORE " " TO Placemark
  90.     STORE "               " TO Findstud
  91.   ELSE
  92.     STORE T TO Finish
  93. *
  94. IF Finish
  95.   ERASE
  96.   USE Xstudent Index Xlname,Xid
  97.   DISPLAY OFF TRIM (Fname),Lname for *
  98.   ?
  99.   INPUT "Are you sure?  Sure you want the activation (Y/N)?" to Query2
  100.     IF Query2
  101.       ERASE
  102.       USE Xstudent
  103. @ 10,11 SAY "Why not go downstairs and turn off the the T.V. & lights?"
  104. @ 12,11 SAY "This will probably take 45 seconds or so; you have time."
  105. @ 15,14 SAY "When you get back, the transfer will be complete."
  106. @ 17,14 SAY "You'll then be positioned back at the Main Menu."
  107.       PACK
  108.       INDEX on Lname+Fname TO Xlname
  109.       INDEX on Acct:num TO XID
  110.     ELSE
  111.       RECALL ALL
  112.     ENDIF
  113.   ERASE
  114. ENDIF
  115. STORE F to Delerec
  116. DELETE file Tfile
  117. ENDDO
  118. RELEASE Editrec,Mname,Placemark,Drec,Query,Query2,Finish,Repeat,Findstud
  119. USE
  120. SET Talk ON
  121. RETURN
  122. * EOF
  123. indstud
  124.   ELSE
  125.     STORE T TO Finish
  126. *
  127. IF Finish
  128.   ERASE
  129.   USE Xstudent Index Xlname,Xid
  130.   DISPLAY OFF TRIM (Fname),Lname for