home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #3 / amigamamagazinepolishissue1998.iso / bazy / fiasco_2.1 / arexx / cap.frx < prev    next >
Text File  |  1997-10-06  |  2KB  |  113 lines

  1. /* cap.frx
  2.  * Set the first characters of all words in a field to caps
  3.  * Call: cap.frx <FieldID>
  4.  * Copyright © 1996-1997 Nils Bandener
  5.  * $VER: cap_frx 6.3 (6.10.97)
  6.  */
  7.  
  8. scriptname = "Cap.rexx"
  9.  
  10. Parse Arg Field
  11. Options Results
  12.  
  13. /*
  14.  *  If not called from Fiasco, try to address the active
  15.  *  Fiasco project
  16.  */
  17.  
  18. if ~abbrev(address(), "FIASCO.") then
  19. do
  20.     ports = show("Ports")
  21.  
  22.     do i = 1 to words(ports)
  23.  
  24.         if abbrev(word(ports, i), "FIASCO.") then
  25.         do
  26.             Address Value word(ports, i)
  27.  
  28.             GetAttr Project Name Active ARexx
  29.  
  30.             Address Value Result
  31.  
  32.             break
  33.         end
  34.     end
  35. end
  36.  
  37. fiasco_port = address()
  38.  
  39. Signal on Syntax
  40. Signal on Halt
  41. Signal on Break_C
  42. Signal on Failure
  43.  
  44. LockGUI
  45.  
  46. GetField Field Var Cont
  47.  
  48. w = words(Cont)
  49.  
  50. CapCont = ""
  51.  
  52. do i = 1 to w
  53.  
  54.     wo = word(Cont, i)
  55.  
  56.     if CapCont = "" then
  57.     do
  58.         CapCont = upper(left(wo, 1)) || substr(wo, 2)
  59.     end
  60.     else
  61.     do
  62.         CapCont = CapCont upper(left(wo, 1)) || substr(wo, 2)
  63.     end
  64. end
  65.  
  66. SetField Field '"' || CapCont || '"'
  67.  
  68. bail_out:
  69.  
  70. Address Value fiasco_port
  71.  
  72. UnlockGUI
  73. ResetStatus
  74.  
  75. exit
  76.  
  77. syntax:
  78. failure:
  79.  
  80. if show("Ports", fiasco_port) then
  81. do
  82.     Address Value fiasco_port
  83.  
  84.     RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
  85. end
  86. else
  87. do
  88.     say "Error" rc "in line" sigl ":" errortext(rc)
  89.     say "Enter to continue"
  90.     pull dummy
  91. end
  92.  
  93. call bail_out
  94.  
  95. halt:
  96. break_c:
  97.  
  98. if show("Ports", fiasco_port) then
  99. do
  100.     Interpret Address fiasco_port
  101.  
  102.     RequestChoice '"Script Abort Requested" "Cancel" Title "' || scriptname || '"'
  103. end
  104. else
  105. do
  106.     say "*** Break"
  107.     say "Enter to continue"
  108.     pull dummy
  109. end
  110.  
  111. call bail_out
  112.  
  113.