home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / Mathscript_cr.lzx / MathScript / Rexx / Insert_ASCII.ms < prev    next >
Encoding:
Text File  |  1996-06-03  |  955 b   |  45 lines

  1. /* Insert_ASCII.ms V1.0
  2. **
  3. ** Open a string requester where you can enter an ASCII number
  4. ** to be inserted
  5. ** Needs rexxreqtools.library!
  6. **
  7. */
  8.  
  9. options results
  10.  
  11. if ~show('l','rexxreqtools.library') then
  12.     if ~addlib('rexxreqtools.library',0,-30,0) then
  13.         do
  14.             say "Cannot open rexxreqtools.library!"
  15.             exit 20
  16.         end
  17.  
  18. if left(address(),10)~="MATHSCRIPT" then
  19.     do
  20.         call rtezrequest("Run this script from MathScript!")
  21.         exit 10
  22.     end
  23.  
  24.  
  25. ascii=rtgetlong(,"ASCII number:","Insert ASCII","_Insert|_Cancel",,)
  26.  
  27. if ascii="" then exit
  28.  
  29. getstyle
  30.  
  31. style=result
  32.  
  33. select
  34.     when style="Variable" then stylecode="\va"
  35.     when style="Function" then stylecode="\fu"
  36.     when style="Greek" then stylecode="\gr"
  37.     when style="Text" then stylecode="\te"
  38.     when style="Custom1" then stylecode="\c1"
  39.     when style="Custom2" then stylecode="\c2"
  40.     otherwise stylecode=""
  41.     end
  42.  
  43. InsertCode stylecode||D2C(ascii)
  44.  
  45.