home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1995 January / amigagames-1995-01.iso / archive / userbox / publicdomain / ged313.lha / Install / data / main / GoldED / arexx / block.ged < prev    next >
Text File  |  1993-09-24  |  2KB  |  57 lines

  1. /* $VER: 0.9, ©1993 Dietmar Eilert. Mark {...} block.                  */
  2.  
  3. OPTIONS RESULTS                             /* enable return codes     */
  4.  
  5. if (LEFT(ADDRESS(), 6) ~= "GOLDED") then    /* not started by GoldEd ? */
  6.     address 'GOLDED.1'
  7.  
  8. 'LOCK CURRENT'                              /* lock GUI, gain access   */
  9. OPTIONS FAILAT 6                            /* ignore warnings         */
  10. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  11.  
  12. /* ------------------------ INSERT YOUR CODE HERE: ------------------- */
  13.  
  14. 'MARK HIDE'
  15. 'QUERY CODE VAR C'                          /* get code under cursor   */
  16.  
  17. 'PING SLOT 0'                               /* remember position       */
  18.  
  19. if ((C ~= 123) & (C ~= 125)) then do        /* not over parenthesis ?  */
  20.  
  21.     'FIND STRING="{" PREV QUIET'            /* search block start      */
  22.  
  23.     if (RC ~= 0) then do
  24.  
  25.         'QUERY CAT'
  26.  
  27.         if (result = "deutsch") then
  28.             'REQUEST BODY="Keine Klammer gefunden ?!"'
  29.         else
  30.             'REQUEST BODY="No parenthesis found ?!"'
  31.  
  32.         'UNLOCK'
  33.         EXIT
  34.     end
  35. end
  36.  
  37. 'MARK SET'                                  /* mark block start        */
  38. 'BRACKET MATCH'                             /* search block end        */
  39.  
  40. if (RC = 0) then                            /* found match ?           */
  41.     'MARK SET'                              /* mark block's end        */
  42. else
  43.     'MARK HIDE'
  44.  
  45. 'PONG SLOT 0'                               /* move to old position    */
  46.  
  47. /* ---------------------------- END OF YOUR CODE --------------------- */
  48.  
  49. 'UNLOCK' /* VERY important: unlock GUI */
  50. EXIT
  51.  
  52. SYNTAX:
  53.  
  54. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  55. 'UNLOCK'
  56. EXIT
  57.