home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / debatech.sit / Home / stack_-1.xml < prev    next >
Extensible Markup Language  |  1990-04-21  |  20KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>9</cardCount>
  7.     <cardID>3276</cardID>
  8.     <listID>7203</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>--- These are the scripts that come with Hypercard . . .on startUpgetHomeInfoDCStartUp --- keeps D.C. stuff separate from H.C. stuffpass startUp -- to a startUp XCMD, if presentend startUpon resumegetHomeInfopass resume -- to a resume XCMD, if presentend resumeon getHomeInfoglobal stacks,applications,documents,userNameset lockScreen to trueset lockMessages to truepush this cardgo to card "User Preferences" of stack "Home"put card field "User Name" into userNameset 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 stacksput field "paths" of card "applications" into applicationsput field "paths" of card "documents" into documentspop cardset lockScreen to falseset lockMessages to falseend getHomeInfoon searchScript pattern,stackName -- search all scripts of a stackset lockMessages to trueif stackName is not empty then go to stack stackNameif the script of this stack contains patternthen edit script of this stackrepeat with i = 1 to the number of bkgndsgo to card 1 of bkgnd iif the script of this bkgnd contains patternthen edit script of bkgndrepeat with j = 1 to the number of bkgnd buttonsif the script of bkgnd button j contains patternthen edit script of bkgnd button jend repeatrepeat with j = 1 to the number of bkgnd fieldsif the script of bkgnd field j contains patternthen edit script of bkgnd field jend repeatend repeatrepeat with i = 1 to the number of cardsgo card iif the script of this card contains patternthen edit script of this cardrepeat with j = 1 to the number of card buttonsif the script of card button j contains patternthen edit script of card button jend repeatrepeat with j = 1 to the number of card fieldsif the script of card field j contains patternthen edit script of card field jend repeatend repeatset lockMessages to falseend searchScripton openStackhide menuBarhide message Boxend openStack--------------------------------------------------------------------------- following script initializes global variables for Debate Coach------------------------------------------------------------------------on DCStartUpglobal gcaseListglobal briefMakingglobal gtypesglobal gqwriteglobal gfieldNamesglobal gbriefFieldsglobal gindentglobal glastIndentglobal gLastFindput "false" into briefMakingput empty into gLastFind--- set up argument types and case field nameslock screenset lockMessages to truepush this cardgo to card "Argument Types" of stack "Home"put field paths into gtypesgo to card "Case Fields" of stack "Home"put field paths into gfieldNamesgo to card "Case List" of stack "Home"put field paths into gcaseListpop cardunlock screenset lockMessages to false--- set up quickwrite defaultsput "Off,1" into line 3 of gqwriteput "On,1" into line 4 of gqwriteput "Off,1" into line 5 of gqwriteput "Off,2" into line 14 of gqwriteput "Off,2" into line 15 of gqwriteput "Off,2" into line 16 of gqwriteput "On,2" into line 17 of gqwriteput "Off,2" into line 18 of gqwriteput "Off,2" into line 19 of gqwrite--- set up indent levelsput 1 & return & 2 & return & 3 & return & 4 into gindentput 1 into glastIndent--- set up brief fieldsput "Case" & return & "Title" & return & "Brief" into gbriefFieldsend DCStartUp--------------------------------------------------------------------------- next script run when a case stack is opened------------------------------------------------------------------------on openCaseglobal briefMakingglobal gFoundlock screenhide menuBarhide message boxhide field sourcehide field yourCardget briefMakingif it is empty then send startUp to stack "Home"if briefmaking thenshow bkgnd button disableBriefMakingshow bkgnd button cardContainerelsehide bkgnd button disableBriefMakinghide bkgnd button cardContainerend ifput "false" into gFoundgo last cardunlock screenend openCase--------------------------------------------------------------------------- next 6 scripts are for the "Ox Box" button------------------------------------------------------------------------on oxBox stackNameget ModalDialog("caseChoices",caseFunction,"cardCenter")if it is "Cancel" then exit to HyperCardif line 3 of it is "on" thenoldCaseelseif line 4 of it is "on" thennewCase stackNameelseif line 5 of it is "on" thendeleteCaseelseif line 6 of it is "on" thenaddCaseelseremoveCaseend ifend ifend ifend ifend oxBoxon oldCase   --- open an old caseglobal gcaseListget XScrollBox(1,"Open which case?",gcaseList)put second item of it into itgo to stack itend oldCaseon newCase stackName   --- create a new caseglobal gcaseListlock screenset lockMessages to trueif stackName is "Briefs" or stackName is "Debate Coach" thengo to stack "Evidence"end ifdoMenu "New Stack..."get the short name of this stackpush this cardgo to card "Case List" of stack "Home"put number of lines in field paths into nlinesput it into line nlines+1 of field pathsput field paths into gcaseListpop cardunlock screenset the lockMessages to falseend newCaseon deleteCase   --- rm old case, both from disk and from listglobal gcaseListget XScrollBox(1,"Delete which case?",gcaseList)put first item of it into caseNumberput second item of it into itpush this cardlock screenset the lockMessages to truego to stack itdoMenu "Delete Stack..."go to card "Case List" of stack "Home"delete line caseNumber of field pathsput field paths into gcaseListpop cardunlock screenset the lockMessages to trueend deleteCaseon addCase   --- add a case to the case listglobal gcaseListput StandardFile("get:Add Case","STAK","WILD") into caseNamelock screenset lockMessages to truepush this cardgo to card "Case List" of stack "Home"put replace(":",",",caseName) into caseNameput number of lines in field paths into nlinesput last item of caseName into line nlines+1 of field pathsput field paths into gcaseListpop cardunlock screenset the lockMessages to falseend addCaseon removeCaseglobal gcaseListget XScrollBox(1,"Delete which case?",gcaseList)put first item of it into caseNumberpush this cardlock screenset the lockMessages to truego to card "Case List" of stack "Home"delete line caseNumber of field pathsput field paths into gcaseListpop cardunlock screenset the lockMessages to trueend removeCase--------------------------------------------------------------------------- next script is for the "search" button (mag glass)------------------------------------------------------------------------on search stackName, chosenTextglobal gFoundglobal glastFindif stackName is not "Home" thenanswer "Search using . . ." with "Cancel" or "New Setup"┬¼or "Old Setup"if it is "Cancel" then exit to HyperCardif it is "New Setup" thenpush this cardgo to card "Search Parameters" of stack "Home"if chosenText is not empty thenput chosenText into field searchTextend ifput stackName into field searchStackexit to HyperCardend ifend ifpush this cardlock screenset the lockMessages to truego to card "Search Parameters" of stack "Home"put field searchStack into sStackput field searchField into sFieldif chosenText is not empty thenput chosenText into sTextelseput field searchText into sTextend ifgo to stack sStackif sText = glastFind thenput true into gFoundelseput false into gFoundend ifput sText into gLastFindif gFound then go next cardif sField is empty thenfind sTextelseget FindInField(field sField,sText)end ifunlock screenset the lockMessages to falseend search--------------------------------------------------------------------------- next script is for the "quickWrite" button (Case stacks)------------------------------------------------------------------------on quickWriteglobal gqwrite--- first get the file to write toanswer "Write card to..." with "Cancel" or "Old File" or "New File"if it is "Cancel" then exit to HyperCardif it is "New File" thenput false into appendput StandardFile("put:New File","New File","Enter case name:")┬¼into caseNameelseif it is "Old File" thenput true into appendput StandardFile("get:Select","TEXT") into caseNameend ifend if--- second get the information to writeget ModalDialog("QuickWrite",gqwrite,"cardCenter")put it into gqwrite---   and set the file creatorget line 14 of gqwriteif it is "on" thenput "EDIT" into creatorelseget line 15 of gqwriteif it is "on" thenput "MACA" into creatorelseget line 16 of gqwriteif it is "on" thenput "MSWD" into creatorelseget line 17 of gqwriteif it is "on" thenput "*TEX" into creatorelseget line 18 of gqwriteif it is "on" thenput "JV01" into creatorelse                           --- must be "other"get line 20 of gqwriteput it into creatorend ifend ifend ifend ifend if--- third set up container writeStuff to write to file---   this is the number or letterget line 7 of gqwriteif it is "on" thenif creator = "*TEX" thenput "/item" into writeStuffelseput line 9 of gqwrite into writeStuffend ifelseput empty into writeStuffend if---   this is the slugget line 4 of gqwriteif it is "on" thenif creator = "*TEX" thenput writeStuff & " " & field slug & return ┬¼& return into writeStuffelseif line 7 of gqwrite is "on" thenput writeStuff & ". " & field slug & return ┬¼& return into writeStuffelseput writeStuff & field slug & return & return into writeStuffend ifend ifelseget line 5 of gqwriteif it is "on" thenif creator = "*TEX" thenput writeStuff & " " & line 6 of gqwrite ┬¼& return & return into writeStuffelseif line 7 of gqwrite is "on" thenput writeStuff & ". " & line 6 of gqwrite ┬¼& return & return into writeStuffelseput writeStuff & line 6 of gqwrite ┬¼& return & return into writeStuffend ifend ifend ifend if---   this is the sourceget line 1 of gqwriteif it is "on" thenif creator = "*TEX" thenput writeStuff & field author & ", " &┬¼field title & ", " & "{/em " & field name & "}, " & field novol ┬¼& return & return into writeStuffelseput writeStuff & field author & ", " &┬¼field title & ", " & field name┬¼ & ", " & field novol ┬¼& return & return into writeStuffend ifend if---   and this is the evidenceget line 2 of gqwriteif it is "on" thenput writeStuff & field evidence & return into writeStuffend if--- fourth write to the fileif not append then   --- new fileWriteToFile writeStuff,true,caseName,append,creatorelse   --- old fileWriteToFile writeStuff,true,caseName,appendend if--- finally reset the radio buttonsput "Off,1" into line 3 of gqwriteput "On,1" into line 4 of gqwriteput "Off,1" into line 5 of gqwriteput "Off,2" into line 14 of gqwriteput "Off,2" into line 15 of gqwriteput "Off,2" into line 16 of gqwriteput "On,2" into line 17 of gqwriteput "Off,2" into line 18 of gqwriteput "Off,2" into line 19 of gqwriteend quickWrite--------------------------------------------------------------------------- next script is for the "quickPrint" button (Case stacks)------------------------------------------------------------------------on quickPrintglobal gqprintget ModalDialog("QuickPrint",gqprint,"cardCenter")put it into gqprint--- printer setupget line 13 of gqprintif it is "on" thenput 0 into dialogCount   --- don't show printer dialogselseput 2 into dialogCount   --- show both printer dialogsend if--- set left margin by indent levelget line 8 of gqprintif it is "on" thenput line 10 of gqprint*36 into leftMargin   --- 0.5 in per levelelseput 36 into leftMargin   --- 0.5 in margin by defaultend if--- print slugget line 4 of gqprintif it is "on" thenput field slug into field yourCardelseget line 5 of gqprintif it is "on" thenput line 6 of gqprint into field yourCardend ifend ifget line 3 of gqprintif it is "off" thenget line 7 of gqprintif it is "on" thenget line 9 of gqprintput it & ". " & field yourCard into field yourCardend ifend if--- print sourceget line 1 of gqprintif it is "on" thenget field sourceif it is empty then   --- use if already generatedput field author into field sourceput field source & ", " & field title into field sourceput field source & ", " & field name into field sourceput field source & ", " & field novol into field sourceend ifput field yourCard & return & return & field source┬¼into field yourCardend if--- print evidenceget line 2 of gqprintif it is "on" thenput field yourCard & return & return & field evidence┬¼into field yourCardprintfield "field yourCard",dialogCount,leftMarginend if--- tidy up the cardput empty into field yourCardend quickPrint--------------------------------------------------------------------------- next script is for the formatFile button (TeX write)------------------------------------------------------------------------on TeX--- first get the file to write toput StandardFile("put:New File","New File","File Name:")┬¼into briefNameif briefName is "Cancel" then exit to HyperCard--- second get the file creatorget ModalDialog("fileFormat",empty,"cardCenter")if it is "Cancel" then exit to HyperCardput it into fileType---   and set the file creatorget line 1 of fileTypeif it is "on" thenput "EDIT" into creatorelseget line 2 of fileTypeif it is "on" thenput "MACA" into creatorelseget line 3 of fileTypeif it is "on" thenput "MSWD" into creatorelseget line 4 of fileTypeif it is "on" thenput "*TEX" into creatorelseget line 5 of fileTypeif it is "on" thenput "JV01" into creatorelse                           --- must be "other"get line 7 of fileTypeput it into creatorend ifend ifend ifend ifend if--- third set up for TeX if necessaryif creator = "*TEX" thenwritetofile "\documentstyle[12pt]{article}",true,briefName,┬¼false,creatorwritetofile return,true,briefName,truewritetofile return,true,briefName,truewritetofile "\begin{document}",true,briefName,truewritetofile return,true,briefName,truewritetofile return,true,briefname,truewritetofile field case,true,briefname,truewritetofile return,true,briefName,truewritetofile return,true,briefname,truewritetofile field title,true,briefname,truewritetofile return,true,briefName,truewritetofile return,true,briefname,truewritetofile "\begin{enumerate}",true,briefname,truewritetofile return,true,briefname,truewritetofile return,true,briefname,trueelsewritetofile field case,true,briefName,false,creatorwritetofile return,true,briefName,truewritetofile return,true,briefname,truewritetofile field title,true,briefname,truewritetofile return,true,briefName,truewritetofile return,true,briefname,trueend if---   next two must be done for all creators or causes problemsput "true" into firstNameLineput "true" into firstSlugLine---   and set up indentsput 1 into currentILput 1 into previousIL--- fourth parse the brief and write itput field brief into brief---   check for special TeX charactersget line 10 of fileTypeif it is "On" and creator = "*TEX" thenput replace("$","\$",brief) into briefput replace("&","\&",brief) into briefput replace("%","\%",brief) into briefput replace("#","\#",brief) into briefput replace("_","\_",brief) into briefend ifget line 11 of fileTypeif it is "On" and creator Γëá "*TEX" thenput replace ("{\rm",empty,brief) into briefput replace ("{\em",empty,brief) into briefput replace ("{\bf",empty,brief) into briefput replace ("{\it",empty,brief) into briefput replace ("}",empty,brief) into briefend if---   parse & writeput 0 into blanklines   --- number of blank lines encountered thus farrepeat with nline = 1 to number of lines in briefget line nline of briefput it into currentLineif currentLine is not empty then   --- text encounteredif blanklines = 0 then  --- indent levelput currentLine into currentILput currentIL - previousIL into difILif creator = "*TEX" thenif difIL > 0 then   --- increase indent levelwritetofile "\begin{enumerate}",true,briefname,truewritetofile return,true,briefname,truewritetofile return,true,briefname,trueelseif difIL < 0 then   --- decrease indent levelrepeat for abs(difIL)   --- one \end{} for each decreasewritetofile "\end{enumerate}",true,briefname,truewritetofile return,true,briefname,truewritetofile return,true,briefname,trueend repeatend ifend if   --- if difIL = 0, no change in indent levelend if   --- end TeX indentsput currentIL into previousILnext repeat   --- not good form, but too much nesting otherwiseend ifif blanklines = 1 then   --- slugif creator = "*TEX" and firstSlugLine thenwritetofile "\item ",true,briefname,trueput "false" into firstSlugLineend ifwritetofile currentLine,true,briefName,truewritetofile return,true,briefName,truewritetofile return,true,briefname,truenext repeatend ifif blanklines = 2 then   --- authorif currentLine is "me" then   --- slug w/o evidenceput 6 into blankLines   --- next line blank; goes to next cardelsewritetofile currentLine,true,briefName,truewritetofile ", ",true,briefname,truewritetofile return,true,briefname,trueend ifnext repeatend ifif blanklines = 3 then   --- titlewritetofile currentLine,true,briefName,truewritetofile ", ",true,briefname,truewritetofile return,true,briefname,truenext repeatend ifif blanklines = 4 then   --- nameif creator = "*TEX" and firstNameLine thenwritetofile "{\em ",true,briefname,trueput "false" into firstNameLineend ifwritetofile currentLine,true,briefName,trueif creator = "*TEX" thenwritetofile "}, ",true,briefname,trueelsewritetofile ", ",true,briefname,trueend ifwritetofile return,true,briefname,truenext repeatend ifif blanklines = 5 then   --- novolwritetofile currentLine,true,briefName,truewritetofile return,true,briefname,truewritetofile return,true,briefname,truenext repeatend ifif blanklines = 6 then   --- evidencewritetofile currentLine,true,briefName,truewritetofile return,true,briefname,truewritetofile return,true,briefname,trueend ifelse   --- encountered blanklineput blanklines + 1 into blanklinesif blanklines = 7 thenput 0 into blanklines   --- next cardput "true" into firstNameLineput "true" into firstSlugLineend ifend ifend repeat--- fianlly finish document if it's TeXif creator = "*TEX" thenrepeat with it = currentIL down to 1writetofile "\end{enumerate}",true,briefname,truewritetofile return,true,briefname,truewritetofile return,true,briefname,trueend repeatwritetofile "\end{document}",true,briefName,trueend ifend TeX--------------------------------------------------------------------------- next script is for the "cardContainer" button (Case stacks)------------------------------------------------------------------------on addCardtoBriefglobal gBriefglobal gindentglobal glastIndentget XScrollBox(glastIndent,"Indent Level:",gindent)if it is "Cancel" then exit to HyperCardput first item of it into indentLevelrepeatif gLastIndent - indentLevel >= -1 then exit repeatanswer "You can only go up one indent level at a time."get XScrollBox(glastIndent,"Indent Level:",gindent)put first item of it into indentLevelend repeatput indentLevel into glastIndentget number of lines in gBriefif it is 0 thenput indentLevel into line it+1 of gBriefelseput indentLevel into line it+2 of gBriefend ifget number of lines in gBriefput field slug into line it+2 of gBriefget number of lines in gBriefput field author into line it+2 of gBriefget number of lines in gBrief--- may not be a titleput field title into tempif temp is empty thenput "-" into line it+2 of gBriefelseput field title into line it+2 of gBriefend if