home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / draftit.zip / Example.MAC < prev    next >
Text File  |  1996-07-02  |  1KB  |  46 lines

  1. /*Example Macro for DraftIT, needs Rexxutil to call
  2. Syssleep (to slow it down for demonstration purposes)*/
  3.    
  4.    CALL RxFuncAdd 'SysLoadFuncs','Rexxutil','SysLoadFuncs'
  5.    CALL SysLoadFuncs
  6.  
  7.    rc = dt_yesno('Do you want to open a new window?')
  8.    if rc = YES then call dt_new
  9.    else do
  10.    call dt_say "I'm going to open one anyway!"
  11.    call dt_new
  12.    end
  13.    call dt_insert 'First line of text.'
  14.    call dt_say 'Now we are going to manipulate this line!'
  15.    call dt_setcursor 0
  16.    call dt_mark 5
  17.    call dt_cut
  18.    rc = dt_pull("What's your name?")
  19.    name = rc
  20.    if rc = NOANSWER then do 
  21.    call dt_say 'You gave no answer. I will call you Jim!'
  22.    name = 'Jim'
  23.    end
  24.    if rc = '' then do 
  25.    call dt_say 'You gave no answer. I will call you Jim!'
  26.    name = 'Jim'
  27.    end
  28.    call dt_insert name"'s"
  29.    call Syssleep 1
  30.    count = length(name)+3
  31.    call dt_say 'And a very poetic line it is!'
  32.    call dt_setcursor count
  33.    call dt_insert 'very poetic '
  34.    rc = dt_getlength()
  35.    call dt_setcursor rc
  36.    call dt_insert (d2c(13)||d2c(10))
  37.    call dt_insert (d2c(13)||d2c(10))
  38.    call dt_insert '  By 'name||', 'Date()
  39.    call Syssleep 2
  40.    call dt_say 'And now I will show you the macro script!'
  41.    call dt_open directory()'\Example.MAC'
  42.    
  43.    
  44.  
  45.    
  46.