home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0925.lha / DonsGenies / DonsGenies.lha / Don'sGenies / GridResize.pprx < prev    next >
Text File  |  1993-05-25  |  921b  |  47 lines

  1. /* This Genie resizes the grid while keeping the same proportions.
  2. Written by Don Cox. Not Public Domain. All rights reserved.    */
  3.  
  4.  
  5. signal on error
  6. signal on syntax
  7. address command
  8. call SafeEndEdit.rexx()
  9. call ppm_AutoUpdate(0)
  10. cr="0a"x
  11.  
  12. currentunits = ppm_GetUnits()
  13. call ppm_SetUnits(2)
  14. gsize = ppm_GetGridSize()
  15. call ppm_SaveText("ram:gridsize",gsize)
  16.  
  17. userinput = ppm_GetUserText(7,"Type percentage of current size")
  18. if userinput = "" then exit_msg()
  19. Xsize = word(gsize,1)
  20. Ysize = word(gsize,2)
  21. userinput = userinput/100
  22. Xsize = Xsize*userinput
  23. Ysize = Ysize*userinput
  24. call ppm_SetGridSize(Xsize,Ysize)
  25. call ppm_SetUnits(currentunits)
  26.  
  27. call exit_msg()
  28.  
  29. end
  30.  
  31. error:
  32. syntax:
  33.     do
  34.     exit_msg("Genie failed due to error: "errortext(rc))
  35.     end
  36.  
  37. exit_msg:
  38.     do
  39.     parse arg message
  40.     if message ~= "" then
  41.     call ppm_Inform(1,message)
  42.     call ppm_ClearStatus()
  43.     call ppm_AutoUpdate(1)
  44.     exit
  45.     end
  46.  
  47.