home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
hypercrd
/
hc1_2_x
/
debatech.sit
/
Home
/
stack.txt
< prev
Wrap
Text File
|
1990-04-21
|
25KB
|
782 lines
-- stack: in
-- format: 8 (HyperCard 1)
-- flags: 0x1000 (none)
-- protect password hash: 0
-- maximum user level: 5 (scripting)
-- window: Rect(x1=0, y1=0, x2=0, y2=0)
-- screen: Rect(x1=0, y1=0, x2=0, y2=0)
-- card dimensions: w=0 h=0
-- scroll: x=0 y=0
-- background count: 4
-- first background id: 2676
-- card count: 9
-- first card id: 3276
-- list block id: 7203
-- print block id: 0
-- font table block id: 0
-- style table block id: 0
-- free block count: 0
-- free size: 0 bytes
-- total size: 37664 bytes
-- stack block size: 22016 bytes
-- created by hypercard version: 0x01208000
-- compacted by hypercard version: 0x01208000
-- modified by hypercard version: 0x01208000
-- opened by hypercard version: 0x01208000
-- patterns[0]: 0x0000000000000000
-- patterns[1]: 0x8000000008000000
-- patterns[2]: 0x8800220088002200
-- patterns[3]: 0x8888222288882222
-- patterns[4]: 0x88AA22AA88AA22AA
-- patterns[5]: 0xCCAA33AACCAA33AA
-- patterns[6]: 0xEEAABBAAEEAABBAA
-- patterns[7]: 0xEEBBBBEEEEBBBBEE
-- patterns[8]: 0xFFBBFFEEFFBBFFEE
-- patterns[9]: 0xFFBBFFFFFFBBFFFF
-- patterns[10]: 0x8010022001084004
-- patterns[11]: 0xFFFFFFFFFFFFFFFF
-- patterns[12]: 0x8822882288228822
-- patterns[13]: 0x1122448811224488
-- patterns[14]: 0xC4800C6843023026
-- patterns[15]: 0xB130031BD8C00C8D
-- patterns[16]: 0xAA00AA00AA00AA00
-- patterns[17]: 0x8822552288225522
-- patterns[18]: 0x8855225588552255
-- patterns[19]: 0x77DD77DD77DD77DD
-- patterns[20]: 0x8000000000000000
-- patterns[21]: 0xAA55AA55AA55AA55
-- patterns[22]: 0x038448300C020101
-- patterns[23]: 0x8244394482010101
-- patterns[24]: 0x8814224188412214
-- patterns[25]: 0x8080413E080814E3
-- patterns[26]: 0x22048C7422179810
-- patterns[27]: 0xBE808808EB088880
-- patterns[28]: 0x25C8328964244C92
-- patterns[29]: 0xA29C41BE2AC914EB
-- patterns[30]: 0x40A00000040A0000
-- patterns[31]: 0x8040200002040800
-- patterns[32]: 0xAA00800088008000
-- patterns[33]: 0xFF80808080808080
-- patterns[34]: 0x081C22C180010204
-- patterns[35]: 0xFF808080FF080808
-- patterns[36]: 0xF87422478F172271
-- patterns[37]: 0xBF00BFBFB0B0B0B0
-- patterns[38]: 0xFF7FBE5DA2418000
-- patterns[39]: 0xFAF5FAF5A050A050
-- checksum: 0x0
----- HyperTalk script -----
--- These are the scripts that come with Hypercard . . .
on startUp
getHomeInfo
DCStartUp --- keeps D.C. stuff separate from H.C. stuff
pass startUp -- to a startUp XCMD, if present
end startUp
on resume
getHomeInfo
pass resume -- to a resume XCMD, if present
end resume
on getHomeInfo
global stacks,applications,documents,userName
set lockScreen to true
set lockMessages to true
push this card
go to card "User Preferences" of stack "Home"
put card field "User Name" into userName
set userLevel to card field "User Level"
set powerKeys to the hilite of button "Power Keys"
set textArrows to the hilite of button "Text Arrows"
set blindTyping to the hilite of button "Blind Typing"
put field "paths" of card "stacks" into stacks
put field "paths" of card "applications" into applications
put field "paths" of card "documents" into documents
pop card
set lockScreen to false
set lockMessages to false
end getHomeInfo
on searchScript pattern,stackName -- search all scripts of a stack
set lockMessages to true
if stackName is not empty then go to stack stackName
if the script of this stack contains pattern
then edit script of this stack
repeat with i = 1 to the number of bkgnds
go to card 1 of bkgnd i
if the script of this bkgnd contains pattern
then edit script of bkgnd
repeat with j = 1 to the number of bkgnd buttons
if the script of bkgnd button j contains pattern
then edit script of bkgnd button j
end repeat
repeat with j = 1 to the number of bkgnd fields
if the script of bkgnd field j contains pattern
then edit script of bkgnd field j
end repeat
end repeat
repeat with i = 1 to the number of cards
go card i
if the script of this card contains pattern
then edit script of this card
repeat with j = 1 to the number of card buttons
if the script of card button j contains pattern
then edit script of card button j
end repeat
repeat with j = 1 to the number of card fields
if the script of card field j contains pattern
then edit script of card field j
end repeat
end repeat
set lockMessages to false
end searchScript
on openStack
hide menuBar
hide message Box
end openStack
------------------------------------------------------------------------
--- following script initializes global variables for Debate Coach
------------------------------------------------------------------------
on DCStartUp
global gcaseList
global briefMaking
global gtypes
global gqwrite
global gfieldNames
global gbriefFields
global gindent
global glastIndent
global gLastFind
put "false" into briefMaking
put empty into gLastFind
--- set up argument types and case field names
lock screen
set lockMessages to true
push this card
go to card "Argument Types" of stack "Home"
put field paths into gtypes
go to card "Case Fields" of stack "Home"
put field paths into gfieldNames
go to card "Case List" of stack "Home"
put field paths into gcaseList
pop card
unlock screen
set lockMessages to false
--- set up quickwrite defaults
put "Off,1" into line 3 of gqwrite
put "On,1" into line 4 of gqwrite
put "Off,1" into line 5 of gqwrite
put "Off,2" into line 14 of gqwrite
put "Off,2" into line 15 of gqwrite
put "Off,2" into line 16 of gqwrite
put "On,2" into line 17 of gqwrite
put "Off,2" into line 18 of gqwrite
put "Off,2" into line 19 of gqwrite
--- set up indent levels
put 1 & return & 2 & return & 3 & return & 4 into gindent
put 1 into glastIndent
--- set up brief fields
put "Case" & return & "Title" & return & "Brief" into gbriefFields
end DCStartUp
------------------------------------------------------------------------
--- next script run when a case stack is opened
------------------------------------------------------------------------
on openCase
global briefMaking
global gFound
lock screen
hide menuBar
hide message box
hide field source
hide field yourCard
get briefMaking
if it is empty then send startUp to stack "Home"
if briefmaking then
show bkgnd button disableBriefMaking
show bkgnd button cardContainer
else
hide bkgnd button disableBriefMaking
hide bkgnd button cardContainer
end if
put "false" into gFound
go last card
unlock screen
end openCase
------------------------------------------------------------------------
--- next 6 scripts are for the "Ox Box" button
------------------------------------------------------------------------
on oxBox stackName
get ModalDialog("caseChoices",caseFunction,"cardCenter")
if it is "Cancel" then exit to HyperCard
if line 3 of it is "on" then
oldCase
else
if line 4 of it is "on" then
newCase stackName
else
if line 5 of it is "on" then
deleteCase
else
if line 6 of it is "on" then
addCase
else
removeCase
end if
end if
end if
end if
end oxBox
on oldCase --- open an old case
global gcaseList
get XScrollBox(1,"Open which case?",gcaseList)
put second item of it into it
go to stack it
end oldCase
on newCase stackName --- create a new case
global gcaseList
lock screen
set lockMessages to true
if stackName is "Briefs" or stackName is "Debate Coach" then
go to stack "Evidence"
end if
doMenu "New Stack..."
get the short name of this stack
push this card
go to card "Case List" of stack "Home"
put number of lines in field paths into nlines
put it into line nlines+1 of field paths
put field paths into gcaseList
pop card
unlock screen
set the lockMessages to false
end newCase
on deleteCase --- rm old case, both from disk and from list
global gcaseList
get XScrollBox(1,"Delete which case?",gcaseList)
put first item of it into caseNumber
put second item of it into it
push this card
lock screen
set the lockMessages to true
go to stack it
doMenu "Delete Stack..."
go to card "Case List" of stack "Home"
delete line caseNumber of field paths
put field paths into gcaseList
pop card
unlock screen
set the lockMessages to true
end deleteCase
on addCase --- add a case to the case list
global gcaseList
put StandardFile("get:Add Case","STAK","WILD") into caseName
lock screen
set lockMessages to true
push this card
go to card "Case List" of stack "Home"
put replace(":",",",caseName) into caseName
put number of lines in field paths into nlines
put last item of caseName into line nlines+1 of field paths
put field paths into gcaseList
pop card
unlock screen
set the lockMessages to false
end addCase
on removeCase
global gcaseList
get XScrollBox(1,"Delete which case?",gcaseList)
put first item of it into caseNumber
push this card
lock screen
set the lockMessages to true
go to card "Case List" of stack "Home"
delete line caseNumber of field paths
put field paths into gcaseList
pop card
unlock screen
set the lockMessages to true
end removeCase
------------------------------------------------------------------------
--- next script is for the "search" button (mag glass)
------------------------------------------------------------------------
on search stackName, chosenText
global gFound
global glastFind
if stackName is not "Home" then
answer "Search using . . ." with "Cancel" or "New Setup" or "Old Setup"
if it is "Cancel" then exit to HyperCard
if it is "New Setup" then
push this card
go to card "Search Parameters" of stack "Home"
if chosenText is not empty then
put chosenText into field searchText
end if
put stackName into field searchStack
exit to HyperCard
end if
end if
push this card
lock screen
set the lockMessages to true
go to card "Search Parameters" of stack "Home"
put field searchStack into sStack
put field searchField into sField
if chosenText is not empty then
put chosenText into sText
else
put field searchText into sText
end if
go to stack sStack
if sText = glastFind then
put true into gFound
else
put false into gFound
end if
put sText into gLastFind
if gFound then go next card
if sField is empty then
find sText
else
get FindInField(field sField,sText)
end if
unlock screen
set the lockMessages to false
end search
------------------------------------------------------------------------
--- next script is for the "quickWrite" button (Case stacks)
------------------------------------------------------------------------
on quickWrite
global gqwrite
--- first get the file to write to
answer "Write card to..." with "Cancel" or "Old File" or "New File"
if it is "Cancel" then exit to HyperCard
if it is "New File" then
put false into append
put StandardFile("put:New File","New File","Enter case name:") into caseName
else
if it is "Old File" then
put true into append
put StandardFile("get:Select","TEXT") into caseName
end if
end if
--- second get the information to write
get ModalDialog("QuickWrite",gqwrite,"cardCenter")
put it into gqwrite
--- and set the file creator
get line 14 of gqwrite
if it is "on" then
put "EDIT" into creator
else
get line 15 of gqwrite
if it is "on" then
put "MACA" into creator
else
get line 16 of gqwrite
if it is "on" then
put "MSWD" into creator
else
get line 17 of gqwrite
if it is "on" then
put "*TEX" into creator
else
get line 18 of gqwrite
if it is "on" then
put "JV01" into creator
else --- must be "other"
get line 20 of gqwrite
put it into creator
end if
end if
end if
end if
end if
--- third set up container writeStuff to write to file
--- this is the number or letter
get line 7 of gqwrite
if it is "on" then
if creator = "*TEX" then
put "/item" into writeStuff
else
put line 9 of gqwrite into writeStuff
end if
else
put empty into writeStuff
end if
--- this is the slug
get line 4 of gqwrite
if it is "on" then
if creator = "*TEX" then
put writeStuff & " " & field slug & return & return into writeStuff
else
if line 7 of gqwrite is "on" then
put writeStuff & ". " & field slug & return & return into writeStuff
else
put writeStuff & field slug & return & return into writeStuff
end if
end if
else
get line 5 of gqwrite
if it is "on" then
if creator = "*TEX" then
put writeStuff & " " & line 6 of gqwrite & return & return into writeStuff
else
if line 7 of gqwrite is "on" then
put writeStuff & ". " & line 6 of gqwrite & return & return into writeStuff
else
put writeStuff & line 6 of gqwrite & return & return into writeStuff
end if
end if
end if
end if
--- this is the source
get line 1 of gqwrite
if it is "on" then
if creator = "*TEX" then
put writeStuff & field author & ", " & field title & ", " & "{/em " & field name & "}, " & field novol & return & return into writeStuff
else
put writeStuff & field author & ", " & field title & ", " & field name¬ & ", " & field novol & return & return into writeStuff
end if
end if
--- and this is the evidence
get line 2 of gqwrite
if it is "on" then
put writeStuff & field evidence & return into writeStuff
end if
--- fourth write to the file
if not append then --- new file
WriteToFile writeStuff,true,caseName,append,creator
else --- old file
WriteToFile writeStuff,true,caseName,append
end if
--- finally reset the radio buttons
put "Off,1" into line 3 of gqwrite
put "On,1" into line 4 of gqwrite
put "Off,1" into line 5 of gqwrite
put "Off,2" into line 14 of gqwrite
put "Off,2" into line 15 of gqwrite
put "Off,2" into line 16 of gqwrite
put "On,2" into line 17 of gqwrite
put "Off,2" into line 18 of gqwrite
put "Off,2" into line 19 of gqwrite
end quickWrite
------------------------------------------------------------------------
--- next script is for the "quickPrint" button (Case stacks)
------------------------------------------------------------------------
on quickPrint
global gqprint
get ModalDialog("QuickPrint",gqprint,"cardCenter")
put it into gqprint
--- printer setup
get line 13 of gqprint
if it is "on" then
put 0 into dialogCount --- don't show printer dialogs
else
put 2 into dialogCount --- show both printer dialogs
end if
--- set left margin by indent level
get line 8 of gqprint
if it is "on" then
put line 10 of gqprint*36 into leftMargin --- 0.5 in per level
else
put 36 into leftMargin --- 0.5 in margin by default
end if
--- print slug
get line 4 of gqprint
if it is "on" then
put field slug into field yourCard
else
get line 5 of gqprint
if it is "on" then
put line 6 of gqprint into field yourCard
end if
end if
get line 3 of gqprint
if it is "off" then
get line 7 of gqprint
if it is "on" then
get line 9 of gqprint
put it & ". " & field yourCard into field yourCard
end if
end if
--- print source
get line 1 of gqprint
if it is "on" then
get field source
if it is empty then --- use if already generated
put field author into field source
put field source & ", " & field title into field source
put field source & ", " & field name into field source
put field source & ", " & field novol into field source
end if
put field yourCard & return & return & field source into field yourCard
end if
--- print evidence
get line 2 of gqprint
if it is "on" then
put field yourCard & return & return & field evidence into field yourCard
printfield "field yourCard",dialogCount,leftMargin
end if
--- tidy up the card
put empty into field yourCard
end quickPrint
------------------------------------------------------------------------
--- next script is for the formatFile button (TeX write)
------------------------------------------------------------------------
on TeX
--- first get the file to write to
put StandardFile("put:New File","New File","File Name:") into briefName
if briefName is "Cancel" then exit to HyperCard
--- second get the file creator
get ModalDialog("fileFormat",empty,"cardCenter")
if it is "Cancel" then exit to HyperCard
put it into fileType
--- and set the file creator
get line 1 of fileType
if it is "on" then
put "EDIT" into creator
else
get line 2 of fileType
if it is "on" then
put "MACA" into creator
else
get line 3 of fileType
if it is "on" then
put "MSWD" into creator
else
get line 4 of fileType
if it is "on" then
put "*TEX" into creator
else
get line 5 of fileType
if it is "on" then
put "JV01" into creator
else --- must be "other"
get line 7 of fileType
put it into creator
end if
end if
end if
end if
end if
--- third set up for TeX if necessary
if creator = "*TEX" then
writetofile "\documentstyle[12pt]{article}",true,briefName, false,creator
writetofile return,true,briefName,true
writetofile return,true,briefName,true
writetofile "\begin{document}",true,briefName,true
writetofile return,true,briefName,true
writetofile return,true,briefname,true
writetofile field case,true,briefname,true
writetofile return,true,briefName,true
writetofile return,true,briefname,true
writetofile field title,true,briefname,true
writetofile return,true,briefName,true
writetofile return,true,briefname,true
writetofile "\begin{enumerate}",true,briefname,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
else
writetofile field case,true,briefName,false,creator
writetofile return,true,briefName,true
writetofile return,true,briefname,true
writetofile field title,true,briefname,true
writetofile return,true,briefName,true
writetofile return,true,briefname,true
end if
--- next two must be done for all creators or causes problems
put "true" into firstNameLine
put "true" into firstSlugLine
--- and set up indents
put 1 into currentIL
put 1 into previousIL
--- fourth parse the brief and write it
put field brief into brief
--- check for special TeX characters
get line 10 of fileType
if it is "On" and creator = "*TEX" then
put replace("$","\$",brief) into brief
put replace("&","\&",brief) into brief
put replace("%","\%",brief) into brief
put replace("#","\#",brief) into brief
put replace("_","\_",brief) into brief
end if
get line 11 of fileType
if it is "On" and creator Γëá "*TEX" then
put replace ("{\rm",empty,brief) into brief
put replace ("{\em",empty,brief) into brief
put replace ("{\bf",empty,brief) into brief
put replace ("{\it",empty,brief) into brief
put replace ("}",empty,brief) into brief
end if
--- parse & write
put 0 into blanklines --- number of blank lines encountered thus far
repeat with nline = 1 to number of lines in brief
get line nline of brief
put it into currentLine
if currentLine is not empty then --- text encountered
if blanklines = 0 then --- indent level
put currentLine into currentIL
put currentIL - previousIL into difIL
if creator = "*TEX" then
if difIL > 0 then --- increase indent level
writetofile "\begin{enumerate}",true,briefname,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
else
if difIL < 0 then --- decrease indent level
repeat for abs(difIL) --- one \end{} for each decrease
writetofile "\end{enumerate}",true,briefname,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
end repeat
end if
end if --- if difIL = 0, no change in indent level
end if --- end TeX indents
put currentIL into previousIL
next repeat --- not good form, but too much nesting otherwise
end if
if blanklines = 1 then --- slug
if creator = "*TEX" and firstSlugLine then
writetofile "\item ",true,briefname,true
put "false" into firstSlugLine
end if
writetofile currentLine,true,briefName,true
writetofile return,true,briefName,true
writetofile return,true,briefname,true
next repeat
end if
if blanklines = 2 then --- author
if currentLine is "me" then --- slug w/o evidence
put 6 into blankLines --- next line blank; goes to next card
else
writetofile currentLine,true,briefName,true
writetofile ", ",true,briefname,true
writetofile return,true,briefname,true
end if
next repeat
end if
if blanklines = 3 then --- title
writetofile currentLine,true,briefName,true
writetofile ", ",true,briefname,true
writetofile return,true,briefname,true
next repeat
end if
if blanklines = 4 then --- name
if creator = "*TEX" and firstNameLine then
writetofile "{\em ",true,briefname,true
put "false" into firstNameLine
end if
writetofile currentLine,true,briefName,true
if creator = "*TEX" then
writetofile "}, ",true,briefname,true
else
writetofile ", ",true,briefname,true
end if
writetofile return,true,briefname,true
next repeat
end if
if blanklines = 5 then --- novol
writetofile currentLine,true,briefName,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
next repeat
end if
if blanklines = 6 then --- evidence
writetofile currentLine,true,briefName,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
end if
else --- encountered blankline
put blanklines + 1 into blanklines
if blanklines = 7 then
put 0 into blanklines --- next card
put "true" into firstNameLine
put "true" into firstSlugLine
end if
end if
end repeat
--- fianlly finish document if it's TeX
if creator = "*TEX" then
repeat with it = currentIL down to 1
writetofile "\end{enumerate}",true,briefname,true
writetofile return,true,briefname,true
writetofile return,true,briefname,true
end repeat
writetofile "\end{document}",true,briefName,true
end if
end TeX
------------------------------------------------------------------------
--- next script is for the "cardContainer" button (Case stacks)
------------------------------------------------------------------------
on addCardtoBrief
global gBrief
global gindent
global glastIndent
get XScrollBox(glastIndent,"Indent Level:",gindent)
if it is "Cancel" then exit to HyperCard
put first item of it into indentLevel
repeat
if gLastIndent - indentLevel >= -1 then exit repeat
answer "You can only go up one indent level at a time."
get XScrollBox(glastIndent,"Indent Level:",gindent)
put first item of it into indentLevel
end repeat
put indentLevel into glastIndent
get number of lines in gBrief
if it is 0 then
put indentLevel into line it+1 of gBrief
else
put indentLevel into line it+2 of gBrief
end if
get number of lines in gBrief
put field slug into line it+2 of gBrief
get number of lines in gBrief
put field author into line it+2 of gBrief
get number of lines in gBrief
--- may not be a title
put field title into temp
if temp is empty then
put "-" into line it+2 of gBrief
else
put field title into line it+2 of gBrief
end if
get number of lines in gBrief
put field name into line it+2 of gBrief
get number of lines in gBrief
put field novol into line it+2 of gBrief
get number of lines in gBrief
put field evidence into line it+2 of gBrief
end addCardtoBrief