home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / debatech.sit / Home / stack.txt < prev   
Text File  |  1990-04-21  |  25KB  |  782 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 4
  11. -- first background id: 2676
  12. -- card count: 9
  13. -- first card id: 3276
  14. -- list block id: 7203
  15. -- print block id: 0
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 37664 bytes
  21. -- stack block size: 22016 bytes
  22. -- created by hypercard version: 0x01208000
  23. -- compacted by hypercard version: 0x01208000
  24. -- modified by hypercard version: 0x01208000
  25. -- opened by hypercard version: 0x01208000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. --- These are the scripts that come with Hypercard . . .
  69.  
  70. on startUp
  71.   getHomeInfo
  72.   DCStartUp --- keeps D.C. stuff separate from H.C. stuff
  73.   pass startUp -- to a startUp XCMD, if present
  74. end startUp
  75.  
  76. on resume
  77.   getHomeInfo
  78.   pass resume -- to a resume XCMD, if present
  79. end resume
  80.  
  81. on getHomeInfo
  82.   global stacks,applications,documents,userName
  83.   set lockScreen to true
  84.   set lockMessages to true
  85.   push this card
  86.   go to card "User Preferences" of stack "Home"
  87.   put card field "User Name" into userName
  88.   set userLevel to card field "User Level"
  89.   set powerKeys to the hilite of button "Power Keys"
  90.   set textArrows to the hilite of button "Text Arrows"
  91.   set blindTyping to the hilite of button "Blind Typing"
  92.   put field "paths" of card "stacks" into stacks
  93.   put field "paths" of card "applications" into applications
  94.   put field "paths" of card "documents" into documents
  95.   pop card
  96.   set lockScreen to false
  97.   set lockMessages to false
  98. end getHomeInfo
  99.  
  100. on searchScript pattern,stackName -- search all scripts of a stack
  101.   set lockMessages to true
  102.   if stackName is not empty then go to stack stackName
  103.  
  104.   if the script of this stack contains pattern
  105.   then edit script of this stack
  106.  
  107.   repeat with i = 1 to the number of bkgnds
  108.     go to card 1 of bkgnd i
  109.     if the script of this bkgnd contains pattern
  110.     then edit script of bkgnd
  111.  
  112.     repeat with j = 1 to the number of bkgnd buttons
  113.       if the script of bkgnd button j contains pattern
  114.       then edit script of bkgnd button j
  115.     end repeat
  116.  
  117.     repeat with j = 1 to the number of bkgnd fields
  118.       if the script of bkgnd field j contains pattern
  119.       then edit script of bkgnd field j
  120.     end repeat
  121.  
  122.   end repeat
  123.  
  124.   repeat with i = 1 to the number of cards
  125.     go card i
  126.     if the script of this card contains pattern
  127.     then edit script of this card
  128.  
  129.     repeat with j = 1 to the number of card buttons
  130.       if the script of card button j contains pattern
  131.       then edit script of card button j
  132.     end repeat
  133.  
  134.     repeat with j = 1 to the number of card fields
  135.       if the script of card field j contains pattern
  136.       then edit script of card field j
  137.     end repeat
  138.  
  139.   end repeat
  140.   set lockMessages to false
  141. end searchScript
  142.  
  143. on openStack
  144.   hide menuBar
  145.   hide message Box
  146. end openStack
  147.  
  148. ------------------------------------------------------------------------
  149. --- following script initializes global variables for Debate Coach
  150. ------------------------------------------------------------------------
  151.  
  152. on DCStartUp
  153.   global gcaseList
  154.   global briefMaking
  155.   global gtypes
  156.   global gqwrite
  157.   global gfieldNames
  158.   global gbriefFields
  159.   global gindent
  160.   global glastIndent
  161.   global gLastFind
  162.   put "false" into briefMaking
  163.   put empty into gLastFind
  164.   --- set up argument types and case field names
  165.   lock screen
  166.   set lockMessages to true
  167.   push this card
  168.   go to card "Argument Types" of stack "Home"
  169.   put field paths into gtypes
  170.   go to card "Case Fields" of stack "Home"
  171.   put field paths into gfieldNames
  172.   go to card "Case List" of stack "Home"
  173.   put field paths into gcaseList
  174.   pop card
  175.   unlock screen
  176.   set lockMessages to false
  177.   --- set up quickwrite defaults
  178.   put "Off,1" into line 3 of gqwrite
  179.   put "On,1" into line 4 of gqwrite
  180.   put "Off,1" into line 5 of gqwrite
  181.   put "Off,2" into line 14 of gqwrite
  182.   put "Off,2" into line 15 of gqwrite
  183.   put "Off,2" into line 16 of gqwrite
  184.   put "On,2" into line 17 of gqwrite
  185.   put "Off,2" into line 18 of gqwrite
  186.   put "Off,2" into line 19 of gqwrite
  187.   --- set up indent levels
  188.   put 1 & return & 2 & return & 3 & return & 4 into gindent
  189.   put 1 into glastIndent
  190.   --- set up brief fields
  191.   put "Case" & return & "Title" & return & "Brief" into gbriefFields
  192. end DCStartUp
  193.  
  194. ------------------------------------------------------------------------
  195. --- next script run when a case stack is opened
  196. ------------------------------------------------------------------------
  197.  
  198. on openCase
  199.   global briefMaking
  200.   global gFound
  201.   lock screen
  202.   hide menuBar
  203.   hide message box
  204.   hide field source
  205.   hide field yourCard
  206.   get briefMaking
  207.   if it is empty then send startUp to stack "Home"
  208.   if briefmaking then
  209.     show bkgnd button disableBriefMaking
  210.     show bkgnd button cardContainer
  211.   else
  212.     hide bkgnd button disableBriefMaking
  213.     hide bkgnd button cardContainer
  214.   end if
  215.   put "false" into gFound
  216.   go last card
  217.   unlock screen
  218. end openCase
  219.  
  220. ------------------------------------------------------------------------
  221. --- next 6 scripts are for the "Ox Box" button
  222. ------------------------------------------------------------------------
  223.  
  224. on oxBox stackName
  225.   get ModalDialog("caseChoices",caseFunction,"cardCenter")
  226.   if it is "Cancel" then exit to HyperCard
  227.   if line 3 of it is "on" then
  228.     oldCase
  229.   else
  230.     if line 4 of it is "on" then
  231.       newCase stackName
  232.     else
  233.       if line 5 of it is "on" then
  234.         deleteCase
  235.       else
  236.         if line 6 of it is "on" then
  237.           addCase
  238.         else
  239.           removeCase
  240.         end if
  241.       end if
  242.     end if
  243.   end if
  244. end oxBox
  245.  
  246. on oldCase   --- open an old case
  247.   global gcaseList
  248.   get XScrollBox(1,"Open which case?",gcaseList)
  249.   put second item of it into it
  250.   go to stack it
  251. end oldCase
  252.  
  253. on newCase stackName   --- create a new case
  254.   global gcaseList
  255.   lock screen
  256.   set lockMessages to true
  257.   if stackName is "Briefs" or stackName is "Debate Coach" then
  258.     go to stack "Evidence"
  259.   end if
  260.   doMenu "New Stack..."
  261.   get the short name of this stack
  262.   push this card
  263.   go to card "Case List" of stack "Home"
  264.   put number of lines in field paths into nlines
  265.   put it into line nlines+1 of field paths
  266.   put field paths into gcaseList
  267.   pop card
  268.   unlock screen
  269.   set the lockMessages to false
  270. end newCase
  271.  
  272. on deleteCase   --- rm old case, both from disk and from list
  273.   global gcaseList
  274.   get XScrollBox(1,"Delete which case?",gcaseList)
  275.   put first item of it into caseNumber
  276.   put second item of it into it
  277.   push this card
  278.   lock screen
  279.   set the lockMessages to true
  280.   go to stack it
  281.   doMenu "Delete Stack..."
  282.   go to card "Case List" of stack "Home"
  283.   delete line caseNumber of field paths
  284.   put field paths into gcaseList
  285.   pop card
  286.   unlock screen
  287.   set the lockMessages to true
  288. end deleteCase
  289.  
  290. on addCase   --- add a case to the case list
  291.   global gcaseList
  292.   put StandardFile("get:Add Case","STAK","WILD") into caseName
  293.   lock screen
  294.   set lockMessages to true
  295.   push this card
  296.   go to card "Case List" of stack "Home"
  297.   put replace(":",",",caseName) into caseName
  298.   put number of lines in field paths into nlines
  299.   put last item of caseName into line nlines+1 of field paths
  300.   put field paths into gcaseList
  301.   pop card
  302.   unlock screen
  303.   set the lockMessages to false
  304. end addCase
  305.  
  306. on removeCase
  307.   global gcaseList
  308.   get XScrollBox(1,"Delete which case?",gcaseList)
  309.   put first item of it into caseNumber
  310.   push this card
  311.   lock screen
  312.   set the lockMessages to true
  313.   go to card "Case List" of stack "Home"
  314.   delete line caseNumber of field paths
  315.   put field paths into gcaseList
  316.   pop card
  317.   unlock screen
  318.   set the lockMessages to true
  319. end removeCase
  320.  
  321. ------------------------------------------------------------------------
  322. --- next script is for the "search" button (mag glass)
  323. ------------------------------------------------------------------------
  324.  
  325. on search stackName, chosenText
  326.   global gFound
  327.   global glastFind
  328.   if stackName is not "Home" then
  329.     answer "Search using . . ." with "Cancel" or "New Setup" or "Old Setup"
  330.     if it is "Cancel" then exit to HyperCard
  331.     if it is "New Setup" then
  332.       push this card
  333.       go to card "Search Parameters" of stack "Home"
  334.       if chosenText is not empty then
  335.         put chosenText into field searchText
  336.       end if
  337.       put stackName into field searchStack
  338.       exit to HyperCard
  339.     end if
  340.   end if
  341.   push this card
  342.   lock screen
  343.   set the lockMessages to true
  344.   go to card "Search Parameters" of stack "Home"
  345.   put field searchStack into sStack
  346.   put field searchField into sField
  347.   if chosenText is not empty then
  348.     put chosenText into sText
  349.   else
  350.     put field searchText into sText
  351.   end if
  352.   go to stack sStack
  353.   if sText = glastFind then
  354.     put true into gFound
  355.   else
  356.     put false into gFound
  357.   end if
  358.   put sText into gLastFind
  359.   if gFound then go next card
  360.   if sField is empty then
  361.     find sText
  362.   else
  363.     get FindInField(field sField,sText)
  364.   end if
  365.   unlock screen
  366.   set the lockMessages to false
  367. end search
  368.  
  369. ------------------------------------------------------------------------
  370. --- next script is for the "quickWrite" button (Case stacks)
  371. ------------------------------------------------------------------------
  372.  
  373. on quickWrite
  374.   global gqwrite
  375.   --- first get the file to write to
  376.   answer "Write card to..." with "Cancel" or "Old File" or "New File"
  377.   if it is "Cancel" then exit to HyperCard
  378.   if it is "New File" then
  379.     put false into append
  380.     put StandardFile("put:New File","New File","Enter case name:") into caseName
  381.   else
  382.     if it is "Old File" then
  383.       put true into append
  384.       put StandardFile("get:Select","TEXT") into caseName
  385.     end if
  386.   end if
  387.   --- second get the information to write
  388.   get ModalDialog("QuickWrite",gqwrite,"cardCenter")
  389.   put it into gqwrite
  390.   ---   and set the file creator
  391.   get line 14 of gqwrite
  392.   if it is "on" then
  393.     put "EDIT" into creator
  394.   else
  395.     get line 15 of gqwrite
  396.     if it is "on" then
  397.       put "MACA" into creator
  398.     else
  399.       get line 16 of gqwrite
  400.       if it is "on" then
  401.         put "MSWD" into creator
  402.       else
  403.         get line 17 of gqwrite
  404.         if it is "on" then
  405.           put "*TEX" into creator
  406.         else
  407.           get line 18 of gqwrite
  408.           if it is "on" then
  409.             put "JV01" into creator
  410.           else                           --- must be "other"
  411.             get line 20 of gqwrite
  412.             put it into creator
  413.           end if
  414.         end if
  415.       end if
  416.     end if
  417.   end if
  418.   --- third set up container writeStuff to write to file
  419.   ---   this is the number or letter
  420.   get line 7 of gqwrite
  421.   if it is "on" then
  422.     if creator = "*TEX" then
  423.       put "/item" into writeStuff
  424.     else
  425.       put line 9 of gqwrite into writeStuff
  426.     end if
  427.   else
  428.     put empty into writeStuff
  429.   end if
  430.   ---   this is the slug
  431.   get line 4 of gqwrite
  432.   if it is "on" then
  433.     if creator = "*TEX" then
  434.       put writeStuff & " " & field slug & return & return into writeStuff
  435.     else
  436.       if line 7 of gqwrite is "on" then
  437.         put writeStuff & ". " & field slug & return & return into writeStuff
  438.       else
  439.         put writeStuff & field slug & return & return into writeStuff
  440.       end if
  441.     end if
  442.   else
  443.     get line 5 of gqwrite
  444.     if it is "on" then
  445.       if creator = "*TEX" then
  446.         put writeStuff & " " & line 6 of gqwrite & return & return into writeStuff
  447.       else
  448.         if line 7 of gqwrite is "on" then
  449.           put writeStuff & ". " & line 6 of gqwrite & return & return into writeStuff
  450.         else
  451.           put writeStuff & line 6 of gqwrite & return & return into writeStuff
  452.         end if
  453.       end if
  454.     end if
  455.   end if
  456.   ---   this is the source
  457.   get line 1 of gqwrite
  458.   if it is "on" then
  459.     if creator = "*TEX" then
  460.       put writeStuff & field author & ", " & field title & ", " & "{/em " & field name & "}, " & field novol & return & return into writeStuff
  461.     else
  462.       put writeStuff & field author & ", " & field title & ", " & field name┬¼ & ", " & field novol & return & return into writeStuff
  463.     end if
  464.   end if
  465.   ---   and this is the evidence
  466.   get line 2 of gqwrite
  467.   if it is "on" then
  468.     put writeStuff & field evidence & return into writeStuff
  469.   end if
  470.   --- fourth write to the file
  471.   if not append then   --- new file
  472.     WriteToFile writeStuff,true,caseName,append,creator
  473.   else   --- old file
  474.     WriteToFile writeStuff,true,caseName,append
  475.   end if
  476.   --- finally reset the radio buttons
  477.   put "Off,1" into line 3 of gqwrite
  478.   put "On,1" into line 4 of gqwrite
  479.   put "Off,1" into line 5 of gqwrite
  480.   put "Off,2" into line 14 of gqwrite
  481.   put "Off,2" into line 15 of gqwrite
  482.   put "Off,2" into line 16 of gqwrite
  483.   put "On,2" into line 17 of gqwrite
  484.   put "Off,2" into line 18 of gqwrite
  485.   put "Off,2" into line 19 of gqwrite
  486. end quickWrite
  487.  
  488. ------------------------------------------------------------------------
  489. --- next script is for the "quickPrint" button (Case stacks)
  490. ------------------------------------------------------------------------
  491.  
  492. on quickPrint
  493.   global gqprint
  494.   get ModalDialog("QuickPrint",gqprint,"cardCenter")
  495.   put it into gqprint
  496.   --- printer setup
  497.   get line 13 of gqprint
  498.   if it is "on" then
  499.     put 0 into dialogCount   --- don't show printer dialogs
  500.   else
  501.     put 2 into dialogCount   --- show both printer dialogs
  502.   end if
  503.   --- set left margin by indent level
  504.   get line 8 of gqprint
  505.   if it is "on" then
  506.     put line 10 of gqprint*36 into leftMargin   --- 0.5 in per level
  507.   else
  508.     put 36 into leftMargin   --- 0.5 in margin by default
  509.   end if
  510.   --- print slug
  511.   get line 4 of gqprint
  512.   if it is "on" then
  513.     put field slug into field yourCard
  514.   else
  515.     get line 5 of gqprint
  516.     if it is "on" then
  517.       put line 6 of gqprint into field yourCard
  518.     end if
  519.   end if
  520.   get line 3 of gqprint
  521.   if it is "off" then
  522.     get line 7 of gqprint
  523.     if it is "on" then
  524.       get line 9 of gqprint
  525.       put it & ". " & field yourCard into field yourCard
  526.     end if
  527.   end if
  528.   --- print source
  529.   get line 1 of gqprint
  530.   if it is "on" then
  531.     get field source
  532.     if it is empty then   --- use if already generated
  533.       put field author into field source
  534.       put field source & ", " & field title into field source
  535.       put field source & ", " & field name into field source
  536.       put field source & ", " & field novol into field source
  537.     end if
  538.     put field yourCard & return & return & field source into field yourCard
  539.   end if
  540.   --- print evidence
  541.   get line 2 of gqprint
  542.   if it is "on" then
  543.     put field yourCard & return & return & field evidence into field yourCard
  544.     printfield "field yourCard",dialogCount,leftMargin
  545.   end if
  546.   --- tidy up the card
  547.   put empty into field yourCard
  548. end quickPrint
  549.  
  550. ------------------------------------------------------------------------
  551. --- next script is for the formatFile button (TeX write)
  552. ------------------------------------------------------------------------
  553.  
  554. on TeX
  555.   --- first get the file to write to
  556.   put StandardFile("put:New File","New File","File Name:") into briefName
  557.   if briefName is "Cancel" then exit to HyperCard
  558.   --- second get the file creator
  559.   get ModalDialog("fileFormat",empty,"cardCenter")
  560.   if it is "Cancel" then exit to HyperCard
  561.   put it into fileType
  562.   ---   and set the file creator
  563.   get line 1 of fileType
  564.   if it is "on" then
  565.     put "EDIT" into creator
  566.   else
  567.     get line 2 of fileType
  568.     if it is "on" then
  569.       put "MACA" into creator
  570.     else
  571.       get line 3 of fileType
  572.       if it is "on" then
  573.         put "MSWD" into creator
  574.       else
  575.         get line 4 of fileType
  576.         if it is "on" then
  577.           put "*TEX" into creator
  578.         else
  579.           get line 5 of fileType
  580.           if it is "on" then
  581.             put "JV01" into creator
  582.           else                           --- must be "other"
  583.             get line 7 of fileType
  584.             put it into creator
  585.           end if
  586.         end if
  587.       end if
  588.     end if
  589.   end if
  590.   --- third set up for TeX if necessary
  591.   if creator = "*TEX" then
  592.     writetofile "\documentstyle[12pt]{article}",true,briefName, false,creator
  593.     writetofile return,true,briefName,true
  594.     writetofile return,true,briefName,true
  595.     writetofile "\begin{document}",true,briefName,true
  596.     writetofile return,true,briefName,true
  597.     writetofile return,true,briefname,true
  598.     writetofile field case,true,briefname,true
  599.     writetofile return,true,briefName,true
  600.     writetofile return,true,briefname,true
  601.     writetofile field title,true,briefname,true
  602.     writetofile return,true,briefName,true
  603.     writetofile return,true,briefname,true
  604.     writetofile "\begin{enumerate}",true,briefname,true
  605.     writetofile return,true,briefname,true
  606.     writetofile return,true,briefname,true
  607.   else
  608.     writetofile field case,true,briefName,false,creator
  609.     writetofile return,true,briefName,true
  610.     writetofile return,true,briefname,true
  611.     writetofile field title,true,briefname,true
  612.     writetofile return,true,briefName,true
  613.     writetofile return,true,briefname,true
  614.   end if
  615.   ---   next two must be done for all creators or causes problems
  616.   put "true" into firstNameLine
  617.   put "true" into firstSlugLine
  618.   ---   and set up indents
  619.   put 1 into currentIL
  620.   put 1 into previousIL
  621.   --- fourth parse the brief and write it
  622.   put field brief into brief
  623.   ---   check for special TeX characters
  624.   get line 10 of fileType
  625.   if it is "On" and creator = "*TEX" then
  626.     put replace("$","\$",brief) into brief
  627.     put replace("&","\&",brief) into brief
  628.     put replace("%","\%",brief) into brief
  629.     put replace("#","\#",brief) into brief
  630.     put replace("_","\_",brief) into brief
  631.   end if
  632.   get line 11 of fileType
  633.   if it is "On" and creator Γëá "*TEX" then
  634.     put replace ("{\rm",empty,brief) into brief
  635.     put replace ("{\em",empty,brief) into brief
  636.     put replace ("{\bf",empty,brief) into brief
  637.     put replace ("{\it",empty,brief) into brief
  638.     put replace ("}",empty,brief) into brief
  639.   end if
  640.   ---   parse & write
  641.   put 0 into blanklines   --- number of blank lines encountered thus far
  642.   repeat with nline = 1 to number of lines in brief
  643.     get line nline of brief
  644.     put it into currentLine
  645.     if currentLine is not empty then   --- text encountered
  646.       if blanklines = 0 then  --- indent level
  647.         put currentLine into currentIL
  648.         put currentIL - previousIL into difIL
  649.         if creator = "*TEX" then
  650.           if difIL > 0 then   --- increase indent level
  651.             writetofile "\begin{enumerate}",true,briefname,true
  652.             writetofile return,true,briefname,true
  653.             writetofile return,true,briefname,true
  654.           else
  655.             if difIL < 0 then   --- decrease indent level
  656.               repeat for abs(difIL)   --- one \end{} for each decrease
  657.                 writetofile "\end{enumerate}",true,briefname,true
  658.                 writetofile return,true,briefname,true
  659.                 writetofile return,true,briefname,true
  660.               end repeat
  661.             end if
  662.           end if   --- if difIL = 0, no change in indent level
  663.         end if   --- end TeX indents
  664.         put currentIL into previousIL
  665.         next repeat   --- not good form, but too much nesting otherwise
  666.       end if
  667.       if blanklines = 1 then   --- slug
  668.         if creator = "*TEX" and firstSlugLine then
  669.           writetofile "\item ",true,briefname,true
  670.           put "false" into firstSlugLine
  671.         end if
  672.         writetofile currentLine,true,briefName,true
  673.         writetofile return,true,briefName,true
  674.         writetofile return,true,briefname,true
  675.         next repeat
  676.       end if
  677.       if blanklines = 2 then   --- author
  678.         if currentLine is "me" then   --- slug w/o evidence
  679.           put 6 into blankLines   --- next line blank; goes to next card
  680.         else
  681.           writetofile currentLine,true,briefName,true
  682.           writetofile ", ",true,briefname,true
  683.           writetofile return,true,briefname,true
  684.         end if
  685.         next repeat
  686.       end if
  687.       if blanklines = 3 then   --- title
  688.         writetofile currentLine,true,briefName,true
  689.         writetofile ", ",true,briefname,true
  690.         writetofile return,true,briefname,true
  691.         next repeat
  692.       end if
  693.       if blanklines = 4 then   --- name
  694.         if creator = "*TEX" and firstNameLine then
  695.           writetofile "{\em ",true,briefname,true
  696.           put "false" into firstNameLine
  697.         end if
  698.         writetofile currentLine,true,briefName,true
  699.         if creator = "*TEX" then
  700.           writetofile "}, ",true,briefname,true
  701.         else
  702.           writetofile ", ",true,briefname,true
  703.         end if
  704.         writetofile return,true,briefname,true
  705.         next repeat
  706.       end if
  707.       if blanklines = 5 then   --- novol
  708.         writetofile currentLine,true,briefName,true
  709.         writetofile return,true,briefname,true
  710.         writetofile return,true,briefname,true
  711.         next repeat
  712.       end if
  713.       if blanklines = 6 then   --- evidence
  714.         writetofile currentLine,true,briefName,true
  715.         writetofile return,true,briefname,true
  716.         writetofile return,true,briefname,true
  717.       end if
  718.     else   --- encountered blankline
  719.       put blanklines + 1 into blanklines
  720.       if blanklines = 7 then
  721.         put 0 into blanklines   --- next card
  722.         put "true" into firstNameLine
  723.         put "true" into firstSlugLine
  724.       end if
  725.     end if
  726.   end repeat
  727.   --- fianlly finish document if it's TeX
  728.   if creator = "*TEX" then
  729.     repeat with it = currentIL down to 1
  730.       writetofile "\end{enumerate}",true,briefname,true
  731.       writetofile return,true,briefname,true
  732.       writetofile return,true,briefname,true
  733.     end repeat
  734.     writetofile "\end{document}",true,briefName,true
  735.   end if
  736. end TeX
  737.  
  738. ------------------------------------------------------------------------
  739. --- next script is for the "cardContainer" button (Case stacks)
  740. ------------------------------------------------------------------------
  741.  
  742. on addCardtoBrief
  743.   global gBrief
  744.   global gindent
  745.   global glastIndent
  746.   get XScrollBox(glastIndent,"Indent Level:",gindent)
  747.   if it is "Cancel" then exit to HyperCard
  748.   put first item of it into indentLevel
  749.   repeat
  750.     if gLastIndent - indentLevel >= -1 then exit repeat
  751.     answer "You can only go up one indent level at a time."
  752.     get XScrollBox(glastIndent,"Indent Level:",gindent)
  753.     put first item of it into indentLevel
  754.   end repeat
  755.   put indentLevel into glastIndent
  756.   get number of lines in gBrief
  757.   if it is 0 then
  758.     put indentLevel into line it+1 of gBrief
  759.   else
  760.     put indentLevel into line it+2 of gBrief
  761.   end if
  762.   get number of lines in gBrief
  763.   put field slug into line it+2 of gBrief
  764.   get number of lines in gBrief
  765.   put field author into line it+2 of gBrief
  766.   get number of lines in gBrief
  767.   --- may not be a title
  768.   put field title into temp
  769.   if temp is empty then
  770.     put "-" into line it+2 of gBrief
  771.   else
  772.     put field title into line it+2 of gBrief
  773.   end if
  774.   get number of lines in gBrief
  775.   put field name into line it+2 of gBrief
  776.   get number of lines in gBrief
  777.   put field novol into line it+2 of gBrief
  778.   get number of lines in gBrief
  779.   put field evidence into line it+2 of gBrief
  780. end addCardtoBrief
  781.  
  782.