Сайт Информационных Технологий

Приложение 1

Метод ExtStr

Аргументы метода: error, end

Код метода:

i '$D(marker) s marker(1)=-1 d ..Newstk()
n chr,res,qt s res="",qt=0,end=0 f s chr=$E(stk,marker(2)) q:qt d
.i $A(chr)=13 s qt=1,marker(2)=marker(2)+1 q
.i chr="" d ..Newstk() s:stk="" qt=1,end=1 q
.s res=res_chr,marker(2)=marker(2)+1
i $E(res,1)'=$C(10) d
. m error(+$O(error(""),-1)+1)=marker
e s $E(res,1)=""
q res

Метод Newstk:

Аргументы метода: нет

Код метода:

s marker(1)=marker(1)+1,marker(2)=1
i marker(1)=0 s marker(2)=3
s stk=$G(^QSPvl("c:\colall.txt",marker(1)))
q

Метод Creatqs

Аргументы метода: нет

Код метода:

n tmp,tempo,qqcav,avtor,qqcfact,qqcprf,qqcwork,avtor,fl
s qqcav="$$$"
s sh=0,sh1=0,sh2=0,kon=0,ends=0,fl=0
s str=""
k ^QS
; m ^Q123("N#####7#")=^Q123("N#####4#")
s ^QS(4,"p","o")="Музей",^QS(4,"p","C")="p"
s ^QS(4,"p$","o")="Коллекция",^QS(4,"p$","C")="p$"
n err,end,marker,stk,flag1,flag2,N,k,t,poisk,qqctvor,objekt,flag3,M,find,p,work,year,ee
n flag4,qqcprfold,qqc1prf,flag5,dnum,def,c,cout,flag6,poledef,pois
n pp,poisk1,ppqqc
s N=1,flag2=0,k=0,poisk="^Q5",flag3=0,flag4=0,flag5=0,flag6=0
f s tmp=..ExtStr(.err,.end) q:end d
.if $e(tmp,$l(tmp))=" " s $e(tmp,$l(tmp))=""
.if tmp="**************" d
..s qqcavtor="p$"_qqcav
..s avtor=..ExtStr(.err,.end)
..s ^QS(4,qqcavtor,"o")="Автор",^QS(4,qqcavtor,"autor")=avtor
..s ^QS(4,qqcavtor,"C")=qqcavtor
..d ..Newqqc(.qqcav)
..s qqcfact="$$%",qqcprf="$$$",qqcwork="$$#"
..s tmp=avtor
..s flag1=0
..s N=1
..
 
..;Ввод информации об авторах
..
.if tmp'="--------------",flag1'=1 d
..;Ввод текста об авторе
..s ^QS(4,qqcavtor,"Txta")=avtor
..s ^QS(4,qqcavtor,"Txta",N)=tmp
..s tmp=$tr(tmp,",:","")
..s N=N+1
..
 
..;Ввод места рождения
..
..if N=3,$f(tmp," ")=0 s ^QS(4,qqcavtor,"plaseB")=""
..if N=3,$f(tmp," ")'=0 s t=$e(tmp,$f(tmp," "),9999),^QS(4,qqcavtor,"plaseB")=t
..
 
..;Ввод годов жизни
..
..if N=3,$f(tmp," ")=0 s ^QS(4,qqcavtor,"DateL")=$tr(tmp," ","")
..if N=4,tmp="" s ^QS(4,qqcavtor,"DateL")=^QS(4,qqcavtor,"DateL")
..if N=4,$f(tmp," ")=0,tmp'="" s ^QS(4,qqcavtor,"DateL")=^QS(4,qqcavtor,"DateL")_"-"_$tr(tmp," ","")
..if N=3,$f(tmp," ")'=0 s t=$e(tmp,1,$f(tmp," ")-1),^QS(4,qqcavtor,"DateL")=$tr(t," ","")
..if N=4,$f(tmp," ")'=0 s t=$e(tmp,1,$f(tmp," ")-1),^QS(4,qqcavtor,"DateL")=^QS(4,qqcavtor,"DateL")_"-"_$tr(t," ","")
..
 
..;Ввод профессии
..
 
..; преобразование регистра--------------------------------------------
..s tmp=$TR(tmp,"ЙЦУКЕНГШЩЗХФЫВАПРОЛДЖЭЯЧСМИТЬБЮЪ","йцукенгшщзхфывапролджэячсмитьбюъ")
..if N=5 s ^QS(4,qqcavtor,"prof")=tmp
..
 
..;Ввод объектов: Факты об авторах, ФактыА
..
..s ^QS(4,qqcavtor_"$$$","o")=^QW(1,"o",1,4),^QS(4,qqcavtor_"$$$","C")=qqcavtor_"$$$"
..if tmp'="" s ^QS(4,qqcavtor_"$$$"_qqcfact,"o")=^QW(1,"o",1,8),^QS(4,qqcavtor_"$$$"_qqcfact,"C")=qqcavtor_"$$$"_qqcfact
..
 
..;Преобразование регистра
..
..s tmp=$$xtrrF^%qfx(tmp)
..s tmp=$tr(tmp,",:","")
..
 
..;Ввод фактов об авторе
..
..if $e(tmp,1)'=" " s flag2=0,k=0
..if $e(tmp,1)=" " s k=k+1
..if k'=1,flag2=0 s tempo=""
..if k=1 s tempo=^QS(4,qqcavtor_"$$$"_qqcfactold,"f")
..if $e(tmp,1)=" " s flag2=1,tmp=tempo_tmp
..if flag2=1,k=1 s qqcfact=qqcfactold
..if tmp'="" s ^QS(4,qqcavtor_"$$$"_qqcfact,"f")=tmp
..if N=3,tmp'="" s ^QS(4,qqcavtor_"$$$"_qqcfact,"f")="РОДИЛСЯ "_tmp
..if N=4,tmp'="" s ^QS(4,qqcavtor_"$$$"_qqcfact,"f")="УМЕР "_tmp
..if N=5 s ^QS(4,qqcavtor_"$$$"_qqcfact,"f")="ПРОФЕССИЯ "_tmp
..if flag2=0 s qqcfactold=qqcfact
..d ..Newqqc(.qqcfact)
..
 
..;Ввод информации о произведениях
..
.if tmp="--------------" s flag1=1,M=0 q
.if flag1=1 d
..s M=M+1
..if M=1 d ..Newqqc(.qqcwork)
..
 
..;Выбор Dpic
..if avtor'="МАЛЮТИН Сергей Васильевич",fl'=1 d
...if M=1 d
....f s poisk=$q(@poisk) q:flag3=1 d
.....if $f(poisk,"Dpic")'=0,poisk'="" s flag3=1,dpic=@poisk,find=$e(@poisk,1) ;w avtor," ",poisk,"=",@poisk,!
....s flag3=0
...if $e(dpic,$l(dpic))=" " s $e(dpic,$l(dpic))=""
..if avtor="МАЛЮТИН Сергей Васильевич" s fl=1
..if fl=1,M=1 d ;s dpic=""
...s pois="^Q5(""N124000000000"")"
...f s pois=$q(@pois) q:pois="" d
....if $f(pois,"Dpic")'=0,$p(@pois,".",2)=$p(tmp,".",1) d ; w $p(@pois,".",2),!
.....s ll=$p(pois,",",1)_",""Txtw"",1)"
.....if tmp=@ll d
......s dpic=$p(@pois,".",1)_"."_$p(tmp,".",1) w dpic," ",@ll,!
......s find=$e(dpic,1)
...
..
..if $e(find,1)=1 s qqctvor="$$%",objekt="живопись"
..if $e(find,1)=2 s qqctvor="$$&",objekt="графика"
..if $e(find,1)=3 s qqctvor="$$'",objekt="скульптура"
..if $e(find,1)=4 s qqctvor="$$(",objekt="декоративно-прикладное"
..
 
..;Ввод объектов:Раздел творчества
..
..s ^QS(4,qqcavtor_qqctvor,"o")=^QW(1,"o",1,5),^QS(4,qqcavtor_qqctvor,"C")=qqcavtor_qqctvor
..s ^QS(4,qqcavtor_qqctvor,"part")=objekt
..
 
..;Выделение года создания произведения
..
..s p=$l(tmp," "),ee=$p(tmp," ",p)
..if M=1,+$e(ee,1) s p=$l(tmp," "),year=$p(tmp," ",p)
..if M=1,'+$e(ee,1) s year=""
..
 
..;Выделение названия произведения
..
..if M=1,'+$e(ee,1) s work=tmp,$p(work," ",1)=""
..if M=1,+$e(ee,1) s p=$l(tmp," "),work=tmp,$p(work," ",1)="",$p(work," ",p)="",p=$l(work,"."),$p(work,".",p)=""
..;if M=1,$e(work,$l(work))="." s $e(work,$l(work))="",work=$tr(work,".","/")
..if M=1,$e(work,1)=" " s $e(work,1)=""
..if M=1,$e(work,$l(work))="." s $e(work,$l(work))=""
..
 
..;Ввод объектов:Произведение
..
..s ^QS(4,qqcavtor_qqctvor_qqcwork,"o")=^QW(1,"o",1,6),^QS(4,qqcavtor_qqctvor_qqcwork,"C")=qqcavtor_qqctvor_qqcwork
..
 
..;Ввод текста о произведениях
..
..if M=1 s ^QS(4,qqcavtor_qqctvor_qqcwork,"Txtw")=tmp
..s ^QS(4,qqcavtor_qqctvor_qqcwork,"Txtw",M)=tmp
..
..if M=1 s ^QS(4,qqcavtor_qqctvor_qqcwork,"work")=work
..s ^QS(4,qqcavtor_qqctvor_qqcwork,"Dpic")=dpic
..s ^QS(4,qqcavtor_qqctvor_qqcwork,"DateW")=year
..
 
..;Выделение size,def
..
..if M=2,$e(tmp,1)'=" " s ^QS(4,qqcavtor_qqctvor_qqcwork,"size")=$p(tmp," ",$l(tmp," ")),$p(tmp," ",$l(tmp," "))=""
..if M=2,$e(tmp,1)'=" ",$e(tmp,$l(tmp))=" " s $e(tmp,$l(tmp))="",^QS(4,qqcavtor_qqctvor_qqcwork,"def")=tmp,def=tmp,flag6=1
..if M=2,$e(tmp,1)=" " s flag5=1
..if M=3,flag5=1 s ^QS(4,qqcavtor_qqctvor_qqcwork,"size")=$p(tmp," ",$l(tmp," ")),flag5=0,$p(tmp," ",$l(tmp," "))="" d
...if $e(tmp,$l(tmp))=" " s $e(tmp,$l(tmp))="",^QS(4,qqcavtor_qqctvor_qqcwork,"def")=tmp,def=tmp,flag6=1
..
..;Обработка def
..if flag6=1 d
...if $e(def,1)=" " s $e(def,1)=""
...s def=$tr(def,".,","")
...s cout=$l(def," ")
...f c=1:1:cout s poledef=$p(def," ",c) d
....;w c," ",poledef," ",def," ",work,!
....if poledef="Фм" s poledef="фанера масло"
....if poledef="Ф" s poledef="фанера"
....if poledef="Хм" s poledef="холст масло"
....if poledef="м" s poledef="масло"
....if poledef="х" s poledef="холст"
....if poledef="Х" s poledef="холст"
....if poledef="Б" s poledef="бумага"
....if poledef="Бакв" s poledef="бумага акварель"
....if poledef="ксилогр" s poledef="ксилография"
....if poledef="акв" s poledef="акварель"
....if poledef="к" s poledef="картон"
....if poledef="К" s poledef="картон"
....if poledef="Км" s poledef="картон масло"
....if poledef="ит" s poledef="итальянский"
....if poledef="кар" s poledef="карандаш"
....if poledef="черн" s poledef="черный"
....if poledef="цв" s poledef="цветной"
....if poledef="цвкар" s poledef="цветной карандаш"
....if poledef="граф" s poledef="графитный"
....if poledef="уг" s poledef="уголь"
....if poledef="линогр" s poledef="линография"
....if poledef="литогр" s poledef="литография"
....s $p(def," ",c)=poledef
...s def=$$xtrrF^%qfx(def)
..s flag6=0
..
 
..;Ввод объектов:Факты
..
..s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"o")=^QW(1,"o",1,7),^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"C")=qqcavtor_qqctvor_qqcwork_qqcprf
..;if flag5=1 s ^QS(4,qqcavtor_qqctvor_qqcwork,"Dnum")=dnum,^QS(4,qqcavtor_qqctvor_qqcwork_qqc1prf,"f")=^QS(4,qqcavtor_qqctvor_qqcwork_qqc1prf,"f")_" "_dnum,flag5=0 q
..
 
..;Преобразование регистра
..s tmp=$$xtrrF^%qfx(tmp)
..s tmp=$tr(tmp,",:","")
..s work=$$xtrrF^%qfx(work)
..
..s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")="ДОПОНИТЕЛЬНОЕ_ОПИСАНИЕ"_" "_tmp
..if $p(tmp," ",1)'="ПОСТ." d
...if M=1 s $p(tmp," ",1)=""
...if M=1,year'="" s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")="ПРОИЗВЕДЕНИЕ "_dpic_" "_work_" "_year,qqc1prf=qqcprf
...if M=1,year="" s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")="ПРОИЗВЕДЕНИЕ "_dpic_" "_work,qqc1prf=qqcprf
...if M=2,$e(tmp,1)'=" " s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")="ОПИСАНИЕ "_def
...if M=2,$e(tmp,1)=" " s qqcprfold=qqcprf,^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")="ДОПОЛНИТЕЛЬНОЕ_ОПИСАНИЕ "_tmp,flag4=1
...if M=3,flag4=1 s ^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")=^QS(4,qqcavtor_qqctvor_qqcwork_qqcprfold,"f"),^QS(4,qqcavtor_qqctvor_qqcwork_qqcprfold,"f")="ОПИСАНИЕ "_def,flag4=0
..if $p(tmp," ",1)="ПОСТ." s $p(tmp," ",1)="ПОСТУПЛЕНИЕ",^QS(4,qqcavtor_qqctvor_qqcwork_qqcprf,"f")=tmp
..d ..Newqqc(.qqcprf)
w !,"error:",! zw err
q

Метод Newqqc

Аргументы метода: qqc

Код метода:

n qq
a if sh=219,ends=1 goto b
if sh=219 s sh=0,$e(qqc,3)=$c(36) goto b
s qq=$e(qqc,3)
s qq=$a(qq)
s qq=qq+1
s qq=$c(qq)
s $e(qqc,3)=qq
s sh=sh+1
q
b
if sh1=219,ends=1 s kon=1 q
if sh1=219 s sh1=0,$e(qqc,2)=$c(36) goto c
s qq=$e(qqc,2)
s qq=$a(qq)
s qq=qq+1
s qq=$c(qq)
s $e(qqc,2)=qq
s sh1=sh1+1
q
c
if sh2=219 s ends=1 goto a
s qq=$e(qqc,1)
s qq=$a(qq)
s qq=qq+1
s qq=$c(qq)
s $e(qqc,1)=qq
s sh2=sh2+1
q

Site of Information Technologies
Designed by  inftech@webservis.ru.