|
Stuff routine for OrCAD SDT-III and IV (DOS)
If you want to add a further part field to any component you have placed on
your schematics you can use these two simple routines: The first one is used
to fragment a tabular file you have already prepared in order to link any
further information you want to a single component (max 3 infos per component,
for example the vendor name, the vendor code and the cost of a LM358 op-amp)
into three different temporary files; the second routine will add the infos of
each file extracted by the previous routine to each component that match
exactly the same part value. It can handle max.9 further part field, this
means that if you want to add more infos you have to use three different stuff
files (or maybe change something on my routines in order to handle more
infos.
This is the file fragmentation routine:
10 rem ****************************************** 20 rem * ROUTINE DI
SCOMPOSIZIONE FILE DI STUFF * 30 rem * DI CARLO
MOZETIC FEBBRAIO 1993 * 40 rem
****************************************** 100 key off:cls 110
H=0:K=0:j=0:s$=" " 120 open "stuf.doc" for input as
#1 130 open "tmp1.stf" for output as #2 140 open "tmp2.stf" for output as
#3 150 open "tmp3.stf" for output as #4 180 print"Wait for .doc file
fragmentation ..." 200 if eof(1) then close #1:close #2:close #3:close
#4:cls:system 210 line input #1,x$ 220 j=j+1:if J=>78 then j=0:goto
200 230 y$=mid$(x$,j,1) 240 if y$<>chr$(39) then goto 220 250
h=h+1 260 t=h/2:if t=int(t) then goto 220 270 if h>2 then goto
290 280 goto 1000 290 if h>4 then goto 310 300 goto 2000 310 if
h>6 then goto 400 320 goto 3000 400 d$=d$+y$ 410 j=j+1:if j=>78
then j=0:goto 200 420 y$=mid$(x$,j,1) 430 if y$<>chr$(39) then goto
400 440 y$=chr$(39) 450 d$=d$+y$ 500 h=0:j=0 510
tmp1$=a$+s$+b$ 520 tmp2$=a$+s$+c$ 530 tmp3$=a$+s$+d$ 560 print
#2,tmp1$ 570 print #3,tmp2$ 580 print #4,tmp3$ 590
a$="":b$="":c$="":d$="" 600 goto 200 1000 a$=a$+y$ 1010 j=j+1:if
j=>78 then j=0:goto 200 1020 y$=mid$(x$,j,1) 1030 if y$<>chr$(39)
then goto 1000 1040 y$=chr$(39) 1050 a$=a$+y$ 1060 goto 250 2000
b$=b$+y$ 2010 j=j+1:if j=>78 then j=0:goto 200 2020
y$=mid$(x$,j,1) 2030 if y$<>chr$(39) then goto 2000 2040
y$=chr$(39) 2050 b$=b$+y$ 2060 goto 250 3000 c$=c$+y$ 3010 j=j+1:if
j=>78 then j=0:goto 200 3020 y$=mid$(x$,j,1) 3030 if y$<>chr$(39)
then goto 3000 3040 y$=chr$(39) 3050 c$=c$+y$ 3060 goto 250 4000 rem
h=contatore apici j=contatore caratteri 4010 rem x$=stringa(linea)
y$=carattere s$=spazi(5) 4020 rem a$=stringa parziale delle stringhe
temporanee 4030 rem b$=stringa parziale di tmp1$ 4040 rem c$=stringa
parziale di tmp2$ 4050 rem d$=stringa parziale di tmp3$ 4060 rem
tmp1$,tmp2$,tmp3$=stringhe temporanee 4070 rem
tmp1.muf,tmp2.muf,tmp3.muf=files temporanei 4080 rem stuf.doc=file
dati 4090 rem esempio di file dati: 4100 rem
'74HC00' 'LB0034'
'Y5603' '..670'
EOF
And now the real "stuff" routine
10 rem **************************************** 20 rem * STUFF SHELL DI
CARLO MOZETIC 02/1993 * 30 rem
**************************************** 100 key off:cls:c=0 110 input
"Nome del file schematico da trattare ? ",a$:print 120 print"Indicare il
numero dei campi da associare ai files temporanei" 130 print:print"0 [zero] =
BYPASS" 140 print:print 150 input"TMP1 [1-8] ",x 160 print 170 if
x>8 then goto 150 180 input"TMP2 [1-8] ",y 190 print 200 if y>8
then goto 180 210 input"TMP3 [1-8] ",z 220 print 230 if z>8 then
goto 210 240 print 250 print"TMP1=";x,"TMP2=";y,"TMP3=";z,"Sei sicuro ?
[y/n]":print 260 j$=inkey$:if j$="" then goto 260 270 if j$="n" then goto
150 280 if j$<>"y" then print"TASTO ERRATO !":beep:print:goto
260 300 print:print"Vuoi conservare i files temporanei ? [y/n]":print 310
k$=inkey$:if k$="" then goto 310 320 if k$="n" then c=1:goto 500 330 if
k$<>"y" then print"TASTO ERRATO !":beep:print:goto 310 500
shell"frag" 510 open "stuf1.bat" for output as #1 520 open "stuf2.bat" for
output as #2 530 open "stuf3.bat" for output as #3 540 f$="fldstuff
" 550 r$=" tmp1.stf/u/i" 560 s$=" tmp2.stf/u/i" 570 t$="
tmp3.stf/u/i" 580 x$=str$(x) 590 y$=str$(y) 600 z$=str$(z) 610 w$="
" 620 p$=f$+a$+w$+x$+r$ 630 q$=f$+a$+w$+y$+s$ 640
l$=f$+a$+w$+z$+t$ 650 print #1,p$ 660 print #2,q$ 670 print
#3,l$ 680 close #1:close #2:close #3 690 shell"cls" 700 if x>0 then
shell"stuf1":cls 710 if y>0 then shell"stuf2":cls 720 if z>0 then
shell"stuf3":cls 750 shell"erase stuf?.bat":cls 800 if c=1 then
shell"erase tmp?.stf":cls 900 system
EOF
You are here: Home-Tips and tricks-Routine for OrCAD
Previous Topic: Spurious analysis Next Topic: WinNT and 98
|