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

  1. %eliba.ccc
  2. *$Header$
  3. *$Log$
  4. **************
  5. * Add a single EC to a library in <ARCALIB>, library name in c10:c17
  6. * From ELIB: r32:0=2D r33:4=end conditions
  7. r32=0
  8. r33=4
  9. :0
  10. mess add from: f-file, c-current drawing, s-selection group
  11. getc c1 1
  12. ascii c1 r13
  13. if r13 eq 102 :f
  14. if r13 eq  99 :c
  15. if r13 eq 115 :s
  16. goto :0
  17. :f
  18. mess file name
  19. :w
  20. getc+ c1 8
  21. if r93 ne 0 :G
  22. c80=' '
  23. c81 3 ='iii'
  24. c85 ='A'
  25. r80=0
  26. r82=0
  27. r83=0
  28. r88=1
  29. command chkfil
  30. if r83 eq 0 :A
  31. :p
  32. mess " #c1 8 " is invalid end-condition name, enter another name
  33. goto :w
  34. :A
  35. if r80 eq 1 :a
  36. mess file for end-cond. " #c1 8 " not found, enter another name
  37. goto :w
  38. :a
  39. mess end-cond. description (1-40 char., no spaces),<ENTER>-no descr.
  40. *getc c211 40
  41. r37=0
  42. r38=40
  43. r39=211
  44. r1=0
  45. ovl getc
  46. if r1 ne 0 :a
  47. r1=0
  48. ovl inclib
  49. if r1 eq 0 :G
  50. if r1 ne 5 :e
  51. mess " #c1 8 " is already in the library, add another object ?
  52. goto :F
  53. :G
  54. if r13 ne 102 :E
  55. mess add another end-condition ?
  56. :F
  57. getyn r1
  58. if r1 ne 0 :0
  59. :E
  60. r1 = -1
  61. macro elib
  62. :e
  63. if r1 eq 1 :1
  64. if r1 eq 2 :2
  65. if r1 eq 3 :3
  66. if r1 eq 11 :6
  67. if r1 eq 12 :4
  68. if r1 eq 21 :4
  69. if r1 eq 22 :4
  70. if r1 eq 13 :5
  71. if r1 eq 23 :5
  72. mess System Error (INCLIB, rc= #r1 )
  73. getwe
  74. goto :q
  75. :1
  76. mess Error reading " #c1 8 " - bad or empty file
  77. getwe
  78. goto :q
  79. :2
  80. mess Error adding name & description to new library object
  81. getwe
  82. goto :q
  83. :3
  84. mess Error creating $E$TMP
  85. getwe
  86. goto :q
  87. :6
  88. mess Error, cannot find the specified library
  89. getwe
  90. goto :q
  91. :4
  92. mess Error copying library to/from $E$TMP
  93. getwe
  94. goto :q
  95. :5
  96. mess Error, disk full
  97. getwe
  98. goto :q
  99. :c
  100. *EXTRACT FROM CURRENT DRAWING
  101. mess file name to save (1-8 char.)
  102. * suggests the loaded file name first time, then the last saved file name
  103. def c201 8
  104. :b
  105. getc c2 8
  106. c201=c2;c202=c3;c203=c4;c204=c5;c205=c6;c206=c7;c207=c8;c208=c9
  107. c80=' '
  108. c81 3 ='iii'
  109. c85 =' '
  110. r80=1
  111. r83=0
  112. r88=2
  113. command chkfil
  114. if r83 eq 0 :r
  115. mess Error, invalid file name, enter name again :
  116. goto :b
  117. :r
  118. if r80 eq 0 :h
  119. if r89 eq 1 :h
  120. r3 = 0
  121. mess file " #c2 8 " already exists, want to overwrite ? <n>
  122. def 'n'
  123. getyn r3
  124. if r3 eq 0 :c
  125. :h
  126. ovl reo
  127. c1='2'
  128. ovl autos
  129. c1=c2;c2=c3;c3=c4;c4=c5;c5=c6;c6=c7;c7=c8;c8=c9
  130. goto :a
  131. *EXTRACT SELECTION GROUP
  132. :s
  133. mess file name to save (1-8 char.)
  134. :v
  135. getc c1 8
  136. ascii c1 r3
  137. if r3 eq 32 :t
  138. c80=' '
  139. c81 3 ='iii'
  140. c85 =' '
  141. r80=1
  142. r83=0
  143. r88=1
  144. command chkfil
  145. if r83 eq 0 :g
  146. :t
  147. mess Error, invalid file name, enter name again :
  148. goto :v
  149. :g
  150. if r80 eq 0 :x
  151. if r89 eq 1 :x
  152. r3=0
  153. mess file " #c1 8 " already exists, wish to overwrite ? <n>
  154. def 'n'
  155. getyn r3
  156. if r3 eq 0 :s
  157. :x
  158. *save c10
  159. c211=c10
  160. c9='e'
  161. ovl dumb
  162. i49=1
  163. c20='a'
  164. r1=0
  165. r2=0
  166. c10 = 'j'
  167. ovl rdumb
  168. if r2 lt 0 :y
  169. goto :z
  170. :y
  171. mess Error accessing extracted object
  172. getwe
  173. goto :q
  174. :z
  175. *restore c10
  176. c10=c211
  177. goto :a
  178. *END
  179. :q
  180. r1=999
  181. macro elib
  182.