home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 58 / af058b.adf / PV21.lha / REXX / MoveObj.pvrx < prev    next >
Text File  |  1991-08-13  |  724b  |  34 lines

  1. /* MoveObj.pvrx---move selected objects by precise increments */
  2.  
  3.  
  4. options results
  5.  
  6. /* Try to get exclusive lock on project window.
  7.     If can't get lock, not polite to interrupt. */
  8. 'Lock'
  9. if rc ~= 0 then exit
  10.  
  11. 'SelectList' Sel; SelN = Result
  12. if SelN = 0 then call Error "No object selected!"
  13.  
  14. 'GetStr "Move X - Move Y (N1 N2)" "OK" "CANCEL"' /* longest prompt */
  15. MCoords = result
  16. if rc ~= 0 | words(MCoords) ~= 2 then,
  17.     call Error "Macro CANCELed or Bad Coords given"
  18.  
  19. MX = subword(MCoords,1,1)    /* extract the X and Y values */
  20. MY = subword(MCoords,2,1)
  21.  
  22. 'PushUndo'
  23. do i = 0 to SelN-1
  24.     'Move'  Sel.i  MX MY
  25. end
  26.  
  27. 'Repair'
  28.  
  29. ERROR:
  30.     arg ErrTxt
  31.     if RC ~= 0 | ErrTxt ~= "" then 'GetBool ErrTxt "Cancel" "Cancel"' 
  32.     'UnLock'
  33.     exit
  34.