home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / cfgldlm.aml < prev    next >
Text File  |  1995-08-10  |  2KB  |  73 lines

  1. /* ------------------------------------------------------------------ */
  2. /* Macro:        CFGLDLM.AML                                          */
  3. /* Written by:   nuText Systems                                       */
  4. /*                                                                    */
  5. /* Description:  This macro displays a configuration dialog box for   */
  6. /*               line delimiter options.                              */
  7. /* ------------------------------------------------------------------ */
  8.  
  9.   include bootpath "define.aml"
  10.  
  11.   var linedlm
  12.   var binlen
  13.   var trunclen
  14.   var delimwin
  15.  
  16.   // change edit field from groupbox
  17.   function changedlm
  18.     dlm = case getrow
  19.             when 1 "0D0A"
  20.             when 2 "0D"
  21.             when 3 "0A"
  22.             otherwise ''
  23.           end
  24.     if dlm then
  25.       buf = getwinbuf delimwin
  26.       oldbuffer = gotobuf delimwin
  27.       col 1
  28.       delchar 16000
  29.       instext dlm
  30.       gotobuf oldbuffer
  31.     else
  32.       currwin delimwin
  33.       col getlinelen + 1
  34.     end
  35.   end
  36.  
  37.   lineopt = case _LineDlm
  38.               when "0D0A"  'c'
  39.               when "0D"    'r'
  40.               when "0A"    'l'
  41.               otherwise    'o'
  42.             end
  43.  
  44.   // create dialog box
  45.   dialog "Line Delimiter Options" 41 12 "cp"
  46.  
  47.   // display delimiter options
  48.   groupbox 'Line Delimiter:' 3 2
  49.     (menu ''
  50.        item " ( ) &CR/LF     (DOS)"
  51.        item " ( ) C&R Only   (MAC)"
  52.        item " ( ) &LF Only   (UNIX)     "
  53.        item " ( ) &Other"
  54.      end) '' lineopt "crlo"
  55.   whenselect "changedlm"
  56.  
  57.   delimwin = field "&Delimiter in hex:   >"  3  8 6 _LineDlm
  58.  
  59.   field "&Binary Line Length: >" 3 10  6 _BinaryLength
  60.   field "&Truncation Length:  >" 3 11  6 _TruncLength
  61.  
  62.   // ok/cancel buttons
  63.   button "O&k"    31 3 8
  64.   button "Cancel" 31 5 8
  65.  
  66.   // display dialog box
  67.   if (getdialog ref lineopt ref linedlm ref binlen ref trunclen ) == 'Ok' then
  68.     setobj LineDlm       linedlm  'prf'
  69.     setobj BinaryLength  binlen   'prf'
  70.     setobj TruncLength   trunclen 'prf'
  71.   end
  72.  
  73.