home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir02
/
f008880.re_
/
f008880.re
Wrap
Text File
|
1996-04-02
|
7KB
|
204 lines
; MSCM.UCM -- Build Microstation Command Menu.
; -- Places IGDS format command menu range blocks
; and command string entries needed for the cell
; to be built.
key 'NoEcho'
set r2=outflg ; save outflg
set outflg=outflg!@2000 ; disable command parser
; mod by e. sutton 06/01/89
cmd nulcmd
msg 'st* Define MicroStation Command Menu *'
; * Save Active parameters and set some of our own *
set A0 = ACTANG ; Save active angle
set R1 = ACTLEV ; Save active level
set R4 = CAFONT ; Save active font
set R5 = TXJUST ; Save text justification
set R6 = TNJUST ; Save node justification
set R8 = IDSYMB ; Save weight and color
key 'Active TXJ LC' ; Set text justification
key 'Active TNJ LB' ; using uStn syntax.
key 'wt=0' ; Set weight, color
key 'co=4' ; and level using
key 'lv=63' ; IGDS syntax.
; Set angle and font
set ACTANG = 0 ; using ucm syntax for
set CAFONT = 1 ; tcb entries.
set I0 = NODSPA ; Save line spacing
set I5 = CHHGT ; Save text height
set I6 = CHWID ; Save text width
set NODSPA = 500 ; Set LS, TH & TW
set CHHGT = 1000 ; using ucm syntax for
set CHWID = 1000 ; tcb entries.
key 'Place Text' ; Optionally place FB/CM Node
key 'FB@012CM'
msg 'cfEnter Text Node Origin'
msg 'prReset to Skip Node Placement'
PLCNDE: get P,NDEPNT, R,CMLOOP
go PLCNDE
NDEPNT: pnt
tst RELERR ne 0,PLCNDE
CMLOOP: key 'NoEcho'
cmd nulcmd
ERRTN:
msg 'cfEnter Action Type (P,U,C,S,D,K,T,M,E,R)'
msg 'prReset to Exit'
GETTYP: get K,TSTUC, R,EXITUC ; Get a valid command type
go GETTYP
TSTUC: msg 'st'
set ucasc = key ; Put input into tcb usasc
tst ucbyt(1) lt 97, noup ; (97 <= a <= 122) ? upcase(a)
tst ucbyt(1) gt 122, noup
set ucbyt(1) = ucbyt(1) & 223
NOUP: set C0 = ucasc(1) + ',' ; Save Command prefix in C0
set C2 = C0 ; Copy to C2 for loop compares
; * Parse command type *
;Z: tst C0 ne 'Z,',MESG ; User defined keyin
; set C3 = 'cfEnter Action String'
; set C2 = ''
; go LLEFT
MESG: tst C0 ne 'M,',APPL ; Display message
set C3 = 'cfEnter Message'
go LLEFT
APPL: tst C0 ne 'A,',PRIM ; Application
set C3 = 'cfEnter Application Number'
go LLEFT
PRIM: tst C0 ne 'P,',TSTUCM ; Primitive
set C3 = 'cfEnter Command Name'
go LLEFT
TSTUCM: tst C0 ne 'U,',RACELL ; User Command
set C3 = 'cfEnter User Command Index Number'
go LLEFT
RACELL: tst C0 ne 'R,',CKCELL ; Place Cell
set C3 = 'cfEnter Cell Name'
go LLEFT
CKCELL: tst C0 ne 'C,',CKSYMB ; Place Cell
set C3 = 'cfEnter Cell Name'
go LLEFT
CKSYMB: tst C0 ne 'S,',TSTTUT ; Place Symbol
set C3 = 'cfEnter Symbol Character'
go LLEFT
TSTTUT: tst C0 ne 'D,',TSTSTR ; Activate a Tutorial
set C3 = 'cfEnter Tutorial Name'
set C2 = 'T,AT='
go LLEFT
TSTSTR: tst C0 eq 'K,',STRMSG ; Text Entry
tst C0 eq 'E,',STRMSG ; Text Entry
tst C0 ne 'T,',GOIVCM
STRMSG: set C3 = 'cfEnter Action String'
go LLEFT
; Invalid command type
GOIVCM: set n0 = n0 - 1 ; Strip "," from end of C0
set msg = 'st* Invalid Action Type <' + C0
set msg = msg + '> *'
msg msg
go ERRTN
LLEFT: msg 'cfDefine Lower Left Corner of the Range'
msg 'prReset to re-define Action Type'
LLGET: get P,SETLL, R,CMLOOP, K,TSTUC
go LLGET
SETLL: msg 'st'
set I1 = XUR ; Save Lower Left Corner
set I2 = YUR ; (I1,I2)
msg 'cfDefine Upper Right Corner of the Range'
msg 'prReset to re-define the Range Block'
URGET: get P,SETUR, R,LLEFT
go URGET
SETUR: set I3 = XUR ; Save Upper Right Corner
set I4 = YUR ; (I3,I4)
tst I1 gt I3,IVRNGE ; Brute force coord check
tst I2 lt I4,PUTMSG
IVRNGE: msg 'st* Invalid Range Points *'
go LLEFT
PUTMSG: msg c3 ; Send approporiate msg for
GETSTR: get K,B4LOOP, R,LLEFT ; command string input
go GETSTR
B4LOOP:
tst C0 eq 'Z,',GOTU ; If User Defined String
set ucasc = key ; Upcase input string
set N1 = 0
set R7 = 1
LOOP: tst R7 gt k0,CKNDXD
tst ucbyt(R7) lt 97,PASS
tst ucbyt(R7) gt 122,PASS
set ucbyt(R7) = ucbyt(R7) & 223
PASS: set C1 = C1 + ucasc(R7)
set R7 = R7 + 1
go LOOP
GOTU: set C1=key
CKNDXD: tst C0 ne 'U,',PLCTXT ; If User Command
tst N1 lt 4,TSTNDX ;
NOTNDX: set C2 = 'T,UC=' ;
go PLCTXT ;
TSTNDX: set ucasc = C1 ; Ck c1 for proper form
set R12 = 1 ; to be used as an
NDLOOP: tst R12 gt N1,NDXDNE ; entry in the uc index.
tst ucbyt(R12) lt 48,NOTNDX ; If indexed uc then set
tst ucbyt(R12) gt 57,NOTNDX ; the cmd string to "U,"
set R12 = R12 + 1 ; else leave as terminated
go NDLOOP ; "UC=" cmd string.
NDXDNE: set C2 = 'U,' ;
PLCTXT: set msg = C2 + C1 ; Concat string to prefix copy
set CUREBL = DFSECT ; Save pointers to msg
set CUREBY = DFBYTE
set A8 = I4 + I2 ; Save the mid-y coordinate
set I12 = A8 / 2 ; of the block in I12
key 'Place Text Fitted' ; and place the text
key msg
pnt I1,I12
pnt I3,I12
tst RELERR ne 0,EXITUC
key 'NoEcho'
cmd nulcmd
set RANGEE(1) = I1 ; Adjust the range to
set RANGEE(2) = I2 ; match that of the box
set RANGEE(4) = I3
set RANGEE(5) = I4
wrt CUREBL,CUREBY ; Rewrite the element
go LLEFT ; Get additional blocks
; of this type
; * Cleanup and exit *
EXITUC: ; Restore saved parameters
set outflg = r2 ; restore outflg
set ACTANG = A0 ; Restore active angle
set NODSPA = I0 ; Restore line spacing
set CHHGT = I5 ; Restore text height
set CHWID = I6 ; Restore text width
set ACTLEV = R1 ; Restore active level
set CAFONT = R4 ; Restore active font
set TXJUST = R5 ; Restore text justification
set TNJUST = R6 ; Restore node justification
set IDSYMB = R8 ; Restore weight and color
cmd nulcmd ; Clear any active command
key 'echo' ; as well as all prompt
msg 'cf' ; fields in order to
msg 'ms' ; leave the user command
msg 'pr' ; in a known state and
msg 'er' ; an orderly fashion.
msg 'st* MicroStation Command Menu UC Exited *'
End