home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Editor / GED403R.LZX / Install / Install.run / GOLDEDDATA / arexx / number.ged < prev    next >
Encoding:
Text File  |  1996-07-26  |  1.9 KB  |  81 lines

  1. /* $VER: 1.0, ©1996 Dietmar Eilert. Number lines. */
  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 RELEASE=4'                    /* lock GUI, gain access   */
  9. if (RC ~= 0) then
  10.     exit
  11.  
  12. OPTIONS FAILAT 6                            /* ignore warnings         */
  13. SIGNAL ON SYNTAX                            /* ensure clean exit       */
  14.  
  15. /* ------------------------- INSERT YOUR CODE HERE: -------------------- */
  16.  
  17. 'QUERY CAT'
  18. isGerman = (result = "deutsch")
  19.  
  20. 'QUERY ANYTEXT'
  21.  
  22. if (result = TRUE) then 
  23.  
  24.     do
  25.         if (isGerman) then
  26.             'REQUEST LONG TITLE="Erste Zeilennummer:" MIN=0 MAX=10000 VAR=FIRST'
  27.         else
  28.             'REQUEST LONG TITLE="Enter 1st number:"   MIN=0 MAX=10000 VAR=FIRST'
  29.  
  30.         if (RC = 0) then do
  31.  
  32.             if (isGerman) then
  33.                 'REQUEST LONG TITLE "Schrittweite:" MIN=1 MAX=1000 OLD=10 VAR=STEP'
  34.             else
  35.                 'REQUEST LONG TITLE "Enter step:"   MIN=1 MAX=1000 OLD=10 VAR=STEP'
  36.  
  37.             if (RC = 0) then do
  38.  
  39.                 'FOLD ALL OPEN=TRUE'
  40.  
  41.                 'QUERY LINES VAR=LINES'
  42.  
  43.                 'SET NAME=INSERT VALUE=TRUE'
  44.  
  45.                 'GOTO LINE=1 COLUMN=1'
  46.  
  47.                 size   = LENGTH(first + lines * step)
  48.                 number = first
  49.  
  50.                 do line = 1 to lines
  51.  
  52.                     'TEXT STAY T="' || right('0000000' || number, size) || ' "'
  53.                     'DOWN'
  54.  
  55.                     number = number + step
  56.                 end
  57.             end
  58.         end
  59.     end
  60.  
  61. else do
  62.  
  63.    if (isGerman) then
  64.        'REQUEST PROBLEM="Kein Text vorhanden ?!"'
  65.     else
  66.        'REQUEST PROBLEM="Text buffer is empty ?!"'
  67. end
  68.  
  69.  
  70.  
  71. /* ---------------------------- END OF YOUR CODE ----------------------- */
  72.  
  73. 'UNLOCK' /* VERY important: unlock GUI */
  74. EXIT
  75.  
  76. SYNTAX:
  77.  
  78. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  79. 'UNLOCK'
  80. EXIT
  81.