home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / util / edit / polyed / rexx / getattr.rexx next >
OS/2 REXX Batch file  |  1994-09-22  |  2KB  |  102 lines

  1. /*
  2. ** $VER: getattr.ped 1.0 (30.8.94) written by Robert Brandner
  3. **
  4. ** Demo of the usage of the GETATTR command
  5. */
  6.  
  7. /* enable return codes */
  8.                
  9. OPTIONS RESULTS
  10.  
  11. /* is PolyEd out there ? */
  12.  
  13. if ~SHOW("Ports", "POLYED.1") then do
  14.     say "Please start PolyEd before running this program."
  15.     exit
  16. end
  17.  
  18. ADDRESS POLYED.1
  19.  
  20. /* First, how to get all informations on the application:
  21. ** The informations are placed in nodes of the stem variable APP. 
  22. ** If we don't use a stem variable all informations are put into
  23. ** the variable RESULT, seperated by spaces.
  24. */
  25.  
  26. 'GETATTR APPLICATION STEM APP.'
  27.  
  28. say "Informations about PolyEd"
  29. say "¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯"
  30. say "Version        :" APP.VERSION
  31. say "Pub Screen     :" APP.SCREEN
  32. say "Current Project:" APP.CURRENT
  33. say "Findstring     :" APP.VAR_FINDSTRING
  34. say "Changestring   :" APP.VAR_CHANGESTRING
  35. say "Learning       :" APP.FLAG_LEARNING
  36. say "Right Border   :" APP.VAR_RIGHTBORDER
  37. say "Overwrite      :" APP.FLAG_OVERWRITE
  38. say
  39. say "and so on..."
  40.  
  41. say "You may now ask for information of specific fields."
  42. say "See documentation for the available fields."
  43. say "Enter no field name for leaving the loop."
  44. say ""
  45.  
  46.  
  47. OPTIONS prompt "application field:"
  48.  
  49. pull field
  50. do while field ~= ""
  51.     'GETATTR APPLICATION FIELD' field
  52.     say field || ":" RESULT
  53.     say ""
  54.     pull field
  55. end
  56.  
  57. /* Now we get a list of all projects */
  58.  
  59. OPTIONS PROMPT
  60.  
  61. say
  62. say "Press <return> for a list of the projects:"
  63. pull
  64. say
  65.  
  66. 'GETATTR PROJECTS STEM P.'
  67. say "Here is a list of the" P.PROJECTS.COUNT "projects of PolyEd:"
  68. say
  69. do i=0 to P.PROJECTS.COUNT-1    /* from 0 to COUNT-1 ! */
  70.     say "["i+1"]" P.PROJECTS.i
  71.  
  72.     /* Here we get the informations on one project
  73.     ** into the stem variable PR. Variables must not be quoted, because
  74.     ** ARexx does not evalute them if they are.
  75.     */
  76.  
  77.     'GETATTR' PROJECT P.PROJECTS.i STEM PR.
  78.     say substr("", 1, 3+length(i)+length(P.PROJECTS.i), "¯")    /* :^) */
  79.     say 'ARexx port        :' PR.AREXX
  80.     say 'complete filename :' PR.FILENAME
  81.     say 'file portion      :' PR.FILE
  82.     say 'path portion      :' PR.PATH
  83.     say 'modifications     :' PR.CHANGES
  84.     say 'lines             :' PR.LINES
  85.     say
  86. end i
  87.  
  88. /* Now a list of the macros */
  89.  
  90. say
  91. say "Press <return> for a list of the macros:"
  92. pull
  93. say
  94.  
  95. 'GETATTR MACROS STEM M.'
  96.  
  97. say "Here is a list of the" M.MACROS.COUNT "macros of PolyEd:"
  98. say
  99. do i=0 to M.MACROS.COUNT-1
  100.     say M.MACROS.i
  101. end i
  102.