home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR36 / KEXX.ZIP / PRGLINES.KEX < prev    next >
Text File  |  1992-12-29  |  2KB  |  72 lines

  1. ************************************************
  2. * PRGLINES.KEX
  3. *
  4. * Function: Remove EDITV and POINT settings set during a call to RUNCMD
  5. * Requires: KEDIT 5.0
  6. * Version:  1.1 (December, 1992)
  7. *
  8. * Parameters:
  9. *  Tail - The EDITV Suffix specified during the RUNCMD call
  10. *
  11. ************************************************
  12.  
  13. TRUE  = 1
  14. FALSE = 0
  15.  
  16. Parse Arg Tail
  17.  
  18. 'Macro Push TEMP'
  19.  
  20. Call ErrorCheck 'Editv Get Total.'Tail
  21. If Total.Tail = '' | Total.Tail <= 0 Then Return 1
  22.  
  23. Call ErrorCheck 'Editv Set Total.'Tail
  24. Call ErrorCheck 'Editv Set Current.'Tail
  25. 'Extract /RING/'
  26.  
  27. Do I = 1 To Total.Tail
  28.  
  29.    Call ErrorCheck 'Editv Get Line.'I'.'Tail
  30.    Call ErrorCheck 'Editv Set Line.'I'.'Tail
  31.    Parse Var Line.I.Tail Fid .
  32.    If EditIfInRing(Fid) Then 'Set Point .'Tail'.'I 'Off'
  33.  
  34. End
  35.  
  36. 'Macro POP TEMP'
  37.  
  38. Return 0
  39.  
  40. ************************************************
  41. * Execute command and check for zero return code
  42. *  If RC is not 0, then bail out with FatalErr
  43. ************************************************
  44. ErrorCheck:
  45.    Parse Arg CmdString
  46.    "NoMsg" CmdString
  47.    If RC \= 0 Then
  48.       Call FatalErr RC "From <"Word(CmdString, 1)">" LastMsg.1()
  49.    Return
  50.  
  51. ************************************************
  52. * Subroutine to bail out with error message in alert box
  53. *  Note: This subroutine never returns to it's caller
  54. ************************************************
  55. FatalErr:
  56.    Parse Arg ReturnCode ErrorMessage
  57.    'Alert' Delimit(ErrorMessage) 'Title $PRGLINES$'
  58.    'Macro POP TEMP'
  59.    Exit ReturnCode
  60.  
  61. ************************************************
  62. * Subroutine to check and see if a file is currently in the ring
  63. ************************************************
  64. EditIfInRing:
  65.    Parse Arg CheckFid .
  66.  
  67.    'Kedit' CheckFid '(New'
  68.    If Size.1() \= 0 Then Return TRUE
  69.  
  70.    'QQuit'
  71.    Return FALSE
  72.