home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p034 / 2.ddi / ARCA / USERDEF / ATRIG.CCC < prev    next >
Encoding:
Text File  |  1993-07-25  |  2.9 KB  |  183 lines

  1. %atrig.ccc
  2. * attach a group of attributes to entities
  3. :j
  4. * check geometric mode activity (c100=' ')
  5. ascii c100 r13
  6. if r13 eq 32 :a
  7. mess illegal command, use \GEOM first !
  8. getwe
  9. goto :j
  10. :a
  11. c1='0' ;* check attributes group status
  12. ovl attrgr
  13. if r2 eq -1 :X
  14. if r2 eq -9 :X
  15. goto :i
  16. :X
  17. mess no attributes group found, press <ENTER> to create it
  18. getw
  19. :A
  20. mess name=value of attribute to add (3-20 char.) (<ENTER> to escape)
  21. r93=0
  22. *getc+ c171 20
  23. r37=0
  24. r38=-20
  25. r39=171
  26. r1=0
  27. ovl getc
  28. if r1 ne 0 :A
  29. if r93 ne 0 :a
  30. ascii c171 r9
  31. if r9 eq 32 :A
  32. c1='a' ;* add
  33. ovl attrgr
  34. if r2 eq -2 :2
  35. if r2 eq -3 :3
  36. if r2 eq -4 :4
  37. if r2 eq -5 :5
  38. if r2 eq -6 :6
  39. if r2 eq -7 :7
  40. if r2 eq -8 :8
  41. repeat :a
  42. :i
  43. mess options: a-Add,d-Delete,u-Update,s-Show,<ENTER>-Attach group
  44. r93 = 0
  45. getc+ c2 1
  46. if r93 ne 0 :t ;* attach
  47. ascii c2 r9
  48. if r9 ge 97 :l
  49. * upper case-switch to low
  50. r9 = r9+32
  51. :l
  52. if r9 eq 97 :A ;* add
  53. if r9 eq 100 :D ;* delete
  54. if r9 eq 115 :S ;* show
  55. if r9 eq 117 :U ;* update
  56. repeat :a
  57. :S
  58. c1='1' ;* display all
  59. ovl attrgr
  60. if r2 ge 0 :o
  61. mess attributes group is empty !
  62. :o
  63. getw
  64. repeat :a
  65. :D
  66. mess name of attribute to delete (<ENTER> to escape)
  67. goto :m
  68. :U
  69. mess name/name=value of attribute to update (<ENTER> to escape)
  70. *goto :m
  71. :m
  72. r93=0
  73. *getc+ c171 20
  74. r37=0
  75. r38=-20
  76. r39=171
  77. r1=0
  78. ovl getc
  79. if r1 ne 0 :m
  80. if r93 ne 0 :a
  81. c1=c2 ;* selected option
  82. ovl attrgr
  83. if r2 ge 0 :c
  84. if r2 eq -1 :1
  85. if r2 eq -9 :9
  86. if r2 eq -2 :2
  87. if r2 eq -3 :3
  88. if r2 eq -4 :4
  89. if r2 eq -5 :5
  90. if r2 eq -6 :6
  91. :c
  92. if r2 ne 3 :b
  93. * r2=3, another entry for update
  94. :s
  95. mess new value of attribute to update
  96. *def c171 20
  97. *getc c171 20
  98. r37=1
  99. r38=20
  100. r39=171
  101. r1=0
  102. ovl getc
  103. if r1 ne 0 :s
  104. c1='u'
  105. ovl attrgr
  106. if r2 eq -2 :2
  107. if r2 eq -3 :3
  108. if r2 eq -4 :4
  109. goto :c
  110. :b
  111. repeat :a
  112. :t
  113. sbreset
  114. * attach attributes
  115. mess attach attributes to: y-selection group, n-single entity <n>
  116. r1=0
  117. def 'n'
  118. getyn r1
  119. if r1 eq 0 :u
  120. i1=0
  121. goto :v
  122. :u
  123. mess entity to attach the attributes to (<ENTER> to escape)
  124. r93 = 0
  125. gete+ i1
  126. if r93 ne 0 :a
  127. mess confirm choice
  128. getyn r1;unshow i1;if r1 eq 1 :w
  129. goto :u
  130. :w
  131. c1='T'
  132. ovl attrgr
  133. if r2 eq -1 :1
  134. if r2 eq -9 :9
  135. if r2 eq -7 :7
  136. sbreset
  137. repeat :u
  138. :v
  139. c1='T'
  140. ovl attrgr
  141. if r2 eq -1 :1
  142. if r2 eq -9 :9
  143. if r2 eq -7 :7
  144. repeat :a
  145. * ERRORS
  146. :1
  147. mess ERROR, no attributes found - only ADD is possible !
  148. getwe
  149. goto :a
  150. :9
  151. mess ERROR, no 'active' attributes found - only ADD/UPDATE possible !
  152. getwe
  153. goto :a
  154. :2
  155. mess ERROR, unable to create attributes file !
  156. getwe
  157. goto :z
  158. :3
  159. mess ERROR, attribute string should be: NAME=VALUE...!
  160. getwe
  161. goto :a
  162. :4
  163. mess ERROR, attribute not found !
  164. getwe
  165. goto :a
  166. :5
  167. mess ERROR, attribute to show not found !
  168. getwe
  169. goto :a
  170. :6
  171. mess ERROR, attribute to add already exists, use UPDATE option !
  172. getwe
  173. goto :a
  174. :7
  175. mess ERROR, too many attributes in group !
  176. getwe
  177. goto :a
  178. :8
  179. mess ERROR, first character of name should NOT be: '$' or '>' or '*'
  180. getwe
  181. goto :a
  182. :z
  183.