home *** CD-ROM | disk | FTP | other *** search
/ DOS Wares / doswares.zip / doswares / DATABASE / DBASE5 / CUA_SAMP.ZIP / MDSKIP.PRG < prev    next >
Encoding:
Text File  |  1994-06-24  |  2.1 KB  |  72 lines

  1.  
  2. *.............................................................................
  3. *
  4. *   Program Name: MDSKIP.PRG          Copyright: Borland International
  5. *   Date Created:  7 Apr 94            Language: dBASE 5.0
  6. *   Time Created: 21:40:11               Author: Borland dBASE R&D
  7. *   /brief/library.src
  8. *.............................................................................
  9.  
  10. *.................................................................
  11. * Procedure Name:   MDSkip
  12. * Parameters:       None
  13. * Ext Memvars:      None
  14. * Description:      Skips the number of records the user requests
  15. *.................................................................
  16. PROCEDURE MDSkip
  17.     PRIVATE lVoid, nRec, oForm
  18.  
  19.     #include "TalkOff.hdb"
  20.     
  21.     oForm = GetForm(This)
  22.     
  23.     IF .NOT. ISBLANK(ALIAS())
  24.         IF RECCOUNT() > 1
  25.             #include "MDSKIP.DFM"
  26.             
  27.             lVoid = MDSkip.sbName2.SetFocus()
  28.             lVoid = MDSkip.ReadModal()
  29.             
  30.             IF MDSkip.Action
  31.                 ON ERROR DO SkError
  32.                 nRec = RECNO()
  33.                 SKIP MDSkip.sbName2.Value
  34.                 ON ERROR
  35.             ENDIF
  36.             
  37.             IF TYPE("oForm.ClassName") = "C"
  38.                 IF oForm.ClassName = "FORM"
  39.                     lVoid = oForm.Refresh()
  40.                 ENDIF
  41.             ENDIF
  42.             
  43.             lVoid = MDSkip.Release()
  44.         ENDIF
  45.     ENDIF
  46.     
  47.     #include "TalkOff.hdb"
  48.     
  49. RETURN
  50.  
  51.  
  52. *...........................................................................
  53. * Procedure Name:   SkError
  54. * Parameters:       Last record number
  55. * Ext Memvars:      None
  56. * Description:      Displays an error message if the record is out of range
  57. *...........................................................................
  58. PROCEDURE SkError
  59. PARAMETERS nRec
  60.     PRIVATE lVoid
  61.     
  62.     IF MDSkip.sbName2.Value > 0
  63.         DO ErrorMsg WITH "Cannot skip past end of file"
  64.     ELSE
  65.         DO ErrorMsg WITH "Cannot skip past beginning of file"
  66.     ENDIF
  67.        
  68.     MDSkip.sbName2.Value = 0
  69.     GOTO nRec
  70. RETURN    
  71.                 
  72.