home *** CD-ROM | disk | FTP | other *** search
- /* This is a debug facility for createhost */
-
- arg host
-
- /* default parameters */
-
-
- alternate.1.0 = "Line Spacing: singlespace "
- alternate.1.1 = "Line Spacing: normal space"
- alternate.1.2 = "Line Spacing: double space"
- count.1 = 0
- choices.1 = 3
-
- alternate.2.0 = "Journal Style: Physical Review"
- alternate.2.1 = "Journal Style: Nuclear Physics"
- choices.2 = 2
- count.2 = 0
-
- alternate.3.0 = "Chapter Numbering: numbered chapters "
- alternate.3.1 = "Chapter Numbering: unnumbered chapters"
- choices.3 = 2
- count.3 = 0
-
- alternate.4.0 = "Equation Numbering: sequential"
- alternate.4.1 = "Equation Numbering: by chapter"
- count.4 = 0
- choices.4 = 2
-
- alternate.5.0 = "Title Page Pub-Block: yes"
- alternate.5.1 = "Title Page Pub-Block: no "
- choices.5 = 2
- count.5 = 0
-
- alternate.6.0 = "Paper Type: theory "
- alternate.6.1 = "Paper Type: experiment"
- choices.6 = 2
- count.6 = 0
-
- alternate.7.0 = "DOE Acknowledgement: yes"
- alternate.7.1 = "DOE Acknowledgement: no "
- choices.7 = 2
- count.7 = 0
-
- alternate.8.0 = "Author Format: Theory "
- alternate.8.1 = "Author Format: Experiment"
- choices.8 = 2
- count.8 = 0
-
- alternate.9.0 = "Abstract: Short "
- alternate.9.1 = "Abstract: Long "
- choices.9 = 2
- count.9 = 0
-
- datestring = "Automatic"
- pubnum = "0000"
- titlestring.1 = ""
- titlestring.2 = ""
- titlestring.3 = ""
- titlestring.4 = ""
- titlestring.5 = ""
-
- author. = ""
- institute. = ""
- submitstring = "Physical Review D"
-
- authornum = 0
-
- blanks = copies(' ',46)
- text = ""
- text=text||"\"||blanks||" Date:\\"||blanks||"Pubnumber:\\\\\\\\\\\\\\"
- text=text||"\\\ Journal:\\ Title:\\ :\\ :\\ :\\ :\\"
- text=text||" Author:\\ Instit:\\ :\\ :\\ :\\"
-
-
- call MenuWindow(MYHOST,PHYZPUBPORT)
- call WindowText(MYHOST,text)
-
- call AddGadget(MYHOST,25,27,"1"," ","%d%1%d")
- call AddGadget(MYHOST,25,45,"2"," ","%d%1%d")
- call AddGadget(MYHOST,25,63,"3"," ","%d%1%d")
- call AddGadget(MYHOST,25,81,"4"," ","%d%1%d")
- call AddGadget(MYHOST,25,99,"5"," ","%d%1%d")
- call AddGadget(MYHOST,25,118,"6"," ","%d%1%d")
- call AddGadget(MYHOST,25,136,"7"," ","%d%1%d")
- call AddGadget(MYHOST,25,154,"8"," ","%d%1%d")
- call AddGadget(MYHOST,480,27,"DATE",datestring,"%d%1%g",180)
- call AddGadget(myhost,480,45,"PUBNUMBER",pubnum,"%d%1%g",180)
- call AddGadget(myhost,25,172,"9"," ","%d%1%d")
- call AddGadget(myhost,100,200,"JOURNAL"," ","%d%1%g",500)
- call AddGadget(myhost,100,218,"TITLE1"," ","%d%1%g",500)
- call AddGadget(myhost,100,236,"TITLE2"," ","%d%1%g",500)
- call AddGadget(myhost,100,254,"TITLE3"," ","%d%1%g",500)
- call AddGadget(myhost,100,272,"TITLE4"," ","%d%1%g",500)
- call AddGadget(myhost,100,290,"TITLE5"," ","%d%1%g",500)
- call AddGadget(myhost,100,308,"AUTHOR"," ","%d%1%g",500)
- call AddGadget(myhost,100,326,"INST1"," ","%d%1%g",500)
- call AddGadget(myhost,100,344,"INST2"," ","%d%1%g",500)
- call AddGadget(myhost,100,362,"INST3"," ","%d%1%g",500)
- call AddGadget(myhost,100,380,"INST4"," ","%d%1%g",500)
-
- loc = screenrows() - 30
- call AddGadget(myhost,125,loc,"ANDAUTHOR"," Add Author ","%d%1%d")
- call AddGadget(myhost,325,loc,"CONTINUE"," Write File ","%d%1%d")
-
- call ActivateGadget(myhost,"DATE")
-
- call RefreshMessage(1)
- call RefreshMessage(2)
- call RefreshMessage(3)
- call RefreshMessage(4)
- call RefreshMessage(5)
- call RefreshMessage(6)
- call RefreshMessage(7)
- call RefreshMessage(8)
- call RefreshMessage(9)
-
- quitflag = 0
-
- do forever
- if quitflag = 1 then leave
- t = waitpkt(PHYZPUBPORT)
- do ff = 1
- p = getpkt(PHYZPUBPORT)
- if c2d(p) = 0 then leave ff
-
- command = getarg(p)
- if command ~= CLOSEWINDOW then name = getarg(p,1)
- t = reply(p, 0)
-
- select
-
- when command = CLOSEWINDOW then do
- call CloseWindow(MYHOST)
- if host = "WB" then queue endcli
- quitflag = 1
- end
- when command = "CONTINUE" then do
- quitflag = 1
- call WriteTexFile('vd0:foo.tex',authornum)
- call CloseWindow(MYHOST)
- if host = "WB" then queue endcli
- end
- when (command < 10) & (command > 0) then do
- count.command = (count.command+1)//choices.command
- call RefreshMessage(command)
- end
- when command = "ANDAUTHOR" then authornum = DoAuthor(authornum)
- when command = "DATE" then call ActivateGadget(myhost,PUBNUMBER)
- when command = "PUBNUMBER" then call ActivateGadget(myhost,JOURNAL)
- when command = "JOURNAL" then call ActivateGadget(myhost,TITLE1)
- when command = "TITLE1" then call ActivateGadget(myhost,TITLE2)
- when command = "TITLE2" then call ActivateGadget(myhost,TITLE3)
- when command = "TITLE3" then call ActivateGadget(myhost,TITLE4)
- when command = "TITLE4" then call ActivateGadget(myhost,TITLE5)
- when command = "TITLE5" then call ActivateGadget(myhost,AUTHOR)
- when command = "AUTHOR" then call ActivateGadget(myhost,INST1)
- when command = "INST1" then call ActivateGadget(myhost,INST2)
- when command = "INST2" then call ActivateGadget(myhost,INST3)
- when command = "INST3" then call ActivateGadget(myhost,INST4)
- when command = "INST4" then call ActivateGadget(myhost,DATE)
- otherwise say command
- end
-
-
- end
- end
-
-
- exit
-
- RefreshMessage:
- arg foo
- count = count.foo
- loctext = foo*18-9 + 25
- string = alternate.foo.count
- call move(myhost,50,loctext)
- call text(myhost,string)
- return
-
- WriteTexFile:
- arg filename, anumber
-
- pubnum = GetVar(MYHOST,PHYZPUBPORT,PUBNUMBER)
- datestring = GetVar(MYHOST,PHYZPUBPORT,DATE)
- journal = GetVar(MYHOST,PHYZPUBPORT,JOURNAL)
- titlestring.1 = GetVar(MYHOST,PHYZPUBPORT,TITLE1)
- titlestring.2 = GetVar(MYHOST,PHYZPUBPORT,TITLE2)
- titlestring.3 = GetVar(MYHOST,PHYZPUBPORT,TITLE3)
- titlestring.4 = GetVar(MYHOST,PHYZPUBPORT,TITLE4)
- titlestring.5 = GetVar(MYHOST,PHYZPUBPORT,TITLE5)
-
-
- checkfile = open(outfile,filename,'W')
-
- if checkfile = 0 then say "couldn't open file for output"
-
- else do
- call writeln outfile, '%macropackage=phyzzx'
- select
- when count.1 = 0 then call writeln outfile, '\singlespace'
- when count.1 = 2 then call writeln outfile, '\doublespace'
- otherwise nop
- end
- if count.2 = 0 then call writeln outfile, '\PHYSREV'
- if count.3 = 1 then call writeln outfile, '\unnumberedchapters'
- if count.4 = 0 then call writeln outfile, '\sequentialequations'
- if count.5 = 1 then call writeln outfile, '\nopubblock'
- call writeln outfile, '\pubnum{'pubnum'}'
- if datestring ~= "Automatic" then call writeln outfile, '\date={'datestring'}'
- select
- when count.6 = 0 then call writeln outfile, '\pubtype{T}'
- when count.6 = 1 then call writeln outfile, '\pubtype{E}'
- when count.6 = 2 then call writeln outfile, '\pubtype{T/E}'
- otherwise nop
- end
- call writeln outfile, '\titlepage'
- call writeln outfile, '\title{'titlestring.1
- do i = 2 to 5
- if titlestring.i ~=" " then call writeln outfile, titlestring.i
- end
-
- if count.7 = 0 then call writeln outfile, '\doeack}'
- else call writeln outfile, '}'
-
- if authornum > 0 then do
- if count.8 = 0 then do
- do i = 1 to authornum
- if i = 1 then do
- call writeln outfile, '\author{'author.1'}'
- call writeln outfile, '\address{'institute.1.1
- do j = 2 to 4
- if institute.1.j ~= "" then call writeln outfile, '\break 'institute.1.j
- end
- call writeln outfile, '}'
- end
- else do
- call writeln outfile, '\andauthor{'author.i'}'
- call writeln outfile, '\address{'institute.i.1
- do j = 2 to 4
- if institute.i.j ~= "" then call writeln outfile, '\break 'institute.i.j
- end
- call writeln outfile, '}'
- end
- end
- end
- else do
- call writeln outfile, '\authors'
- call writeln outfile, '\titlestyle{\twelvepoint\caps }'
- call writeln outfile, '\address{.....,\break ....}'
- end
- end
- if count.9 = 0 then do
- call writeln outfile, '\abstract'
- call writeln outfile, '%abstract body%'
- call writeln outfile, "\submit{" submitstring '}'
- end
- else do
- call writeln outfile, '\submit{' submitstring '}'
- call writeln outfile, '\endpage'
- call writeln outfile, '\abstract'
- call writeln outfile, '%abstract body% '
- call writeln outfile, '\endpage '
- end
- end
-
- call close(outfile)
-
- address command 'e 'filename
- return
-
- /* MenuWindow.rexx - menu making function */
-
- MenuWindow:
-
- arg menuhost, menuport
- address command runwsh "'x=createhost("menuhost||","||menuport||")'"
- mp = openport(menuport)
-
- do i = 1 to 2
- address command 'c:WaitForPort 'menuport
- if RC=0 then leave i
- end
-
- idcmp = 'CLOSEWINDOW+GADGETUP'
- flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL+ACTIVATE'
-
- call OpenWindow(menuhost, 0, 0,screencols(),screenrows(), idcmp, flags)
-
- call setapen(menuhost,2)
- call setbpen(menuhost,1)
- call setdrmd(menuhost,JAM2)
-
- return 0
-
-
- /* GetVar.rexx */
-
- GetVar:
- parse arg menuhost, menuport, gadgetname
- call ReadGadget(menuhost,gadgetname)
- t = waitpkt(menuport)
- p = getpkt(menuport)
- string = getarg(p,1)
- t = reply(p,0)
- string = strip(string)
- return string
-
- /* this gets the author and insitution */
-
- DoAuthor:
-
- arg whichauthor
-
- whichauthor = whichauthor + 1
- author.whichauthor = GetVar(MYHOST,PHYZPUBPORT,AUTHOR)
- institute.whichauthor.1 = GetVar(MYHOST,PHYZPUBPORT,INST1)
- institute.whichauthor.2 = GetVar(MYHOST,PHYZPUBPORT,INST2)
- institute.whichauthor.3 = GetVar(MYHOST,PHYZPUBPORT,INST3)
- institute.whichauthor.4 = GetVar(MYHOST,PHYZPUBPORT,INST4)
-
- return whichauthor
-