home *** CD-ROM | disk | FTP | other *** search
- -- stack: in
- -- format: 8 (HyperCard 1)
- -- flags: 0x0 (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: 1
- -- first background id: 2690
- -- card count: 1
- -- first card id: 3351
- -- list block id: 2142
- -- print block id: 0
- -- font table block id: 0
- -- style table block id: 0
- -- free block count: 0
- -- free size: 0 bytes
- -- total size: 19104 bytes
- -- stack block size: 13312 bytes
- -- created by hypercard version: 0x00000000
- -- compacted by hypercard version: 0x00000000
- -- modified by hypercard version: 0x00000000
- -- opened by hypercard version: 0x00000000
- -- 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 -----
-
-
- -- buttons
- -- 19002: empty line, icon is "Fleet, Nothing"
- -- 19001: currently being edited, icon is "Fleet, White"
- -- 19000: line has been entered, no children, "Fleet, Gray"
- -- 22308: line has been entered, has children, "Fleet, Next Arrow"
-
-
- on OpenStack
- Hide MenuBar
- end OpenStack
-
-
-
- -- the wait times can be optimized
- function GetThere
- put (the ticks + 600) into DieTime
- put 0 into NumOfAttempts
-
- repeat forever
- put NumOfAttempts + 1 into NumOfAttempts
- put FileLockP( background field "Lock File" ) into temp
- if temp is true then
- --put "GotThere" into Msg
- return true
- --else
- --if temp is not false then
- --put ("Debug: IO Error:"&temp) into
- --answer "Debug: GetThere had IO code of "&temp
- --end if
- end if
-
- if the ticks > DieTime then
- answer "Timed out trying to get database" with "Look More" or "Quit"
- if it is "Quit" then return false
- end if
-
- wait (the Random of 40)
- end repeat
- end GetThere
-
-
- on ReleaseLock
- repeat forever
- put FileLockP( background field "Lock File", true ) into temp
- if temp is true then exit ReleaseLock
- --if temp is not false then
- --answer "ReleaseLock CROAKED (normally):"&temp with "ribbit"
- --end if
- wait (the Random of 20)
- end repeat
- end ReleaseLock
-
-
-
-
-
-
-
-
-
-
- -- Go to the correct card in the global stack
- -- eventually throw in multi-user access crap
- function GoGlobalStack
- put name of this card into OurName
- put Word 2 of OurName into OurName
- put char 2 to (length of OurName - 1) of OurName into OurName
- set lockscreen to true
- if GetThere() is false then
- return false
- end if
- go to stack background field "Root Stack"
- go to card OurName
- return true
- end GoGlobalStack
-
-
- --
- -- User is LEAVING this card
- -- -- so take their edited line
- -- -- go to global stack
- -- -- insert it in
- --
- function AddNewEdited
- global TheirLine, Entered
-
- PUSH CARD -- how we get back to our own stack
-
- ExitUserCard -- grab our entered data
-
- if GoGlobalStack() is false then
- POP CARD
- return false
- end if
-
- if Entered is not empty then
- -- enter new data, leave locked
- put Entered into background field ("b" & TheirLine)
- set icon of button ("c" & TheirLine) to 19000
- else
- if TheirLine > 0 and TheirLine < 11 then
- -- clear lock
- set icon of button ("c" & TheirLine) to 19002
- end if
- end if
- return true
- end AddNewEdited
-
-
- --
- --
- --
- on GetEditableLine
- global TheirLine
-
- repeat with TestLine = 1 to 10
- if (icon of button ("c" & TestLine)) is 19002 then
- put TestLine into TheirLine
- set icon of button ("c" & TestLine) to 19001
- exit GetEditableLine
- end if
- end repeat
-
- put 0 into TheirLine -- nothing for them to edit
- end GetEditableLine
-
-
- on QuickCopyPopPaste
- -- seems to take about one sec. even over AppleShare
- doMenu "Copy Card"
- pop card -- back to our own stack
- ReleaseLock -- let others access
- doMenu "Paste Card"
- --hide background button "New Stack"
- --hide background button "Spew to File"
- end QuickCopyPopPaste
-
-
-
- --
- -- Switched to proper card in global stack (somehow)
- -- -- (either stayed in same spot, or higher level routine moved)
- --
- on GetNewEditable
- global TheirLine
-
- GetEditableLine -- fills "TheirLine" with # to edit
- QuickCopyPopPaste
- DeleteAllButThis
- EnterUserCard
- end GetNewEditable
-
-
- -- New Card in global stack
- -- we're starting in current card, any edits have already been added
- on NewGlobalCard WhichLine
-
- put background field "Root Topic" into RootTopic
- put background field ("b" & WhichOne) into NewTopic
- set icon of button ("c" & WhichLine) to 22308
-
- -- build new card, but carry along foreground buttons
- doMenu "Copy Card"
- doMenu "Paste Card"
-
- put (ParentName & "-" & WhichOne) into NewName
- set name of this card to NewName
- put NewName into background field "Card"
- put NewTopic into background field "Topic"
- put RootTopic into background field "Root Topic"
-
- end NewGlobalCard
-
- --
- -- Retrieve information that the user added
- --
- on ExitUserCard
- global TheirLine, Entered
-
- put empty into Entered
- if TheirLine > 0 and TheirLine < 11 then
- put background field ("b" & TheirLine) into Entered
- else
- put 0 into TheirLine -- help out for first time
- put empty into Entered
- end if
- end ExitUserCard
-
- --
- -- Prepare card for user data entry/button pushing
- --
- on EnterUserCard
- global TheirLine, Entered
-
- -- lock text on all lines
- -- remove button if line is not empty
- repeat with iter=1 to 10
- set locktext of background field ("b" & iter) to true
- -- no expansion on someone else's unfinished line
- if background field ("b" & iter) is empty then
- hide button ("c" & iter)
- else
- show button ("c" & iter)
- end if
- end repeat
-
- -- allow editing on "their" line
- if TheirLine > 0 and TheirLine < 11 then
- set locktext of background field ("b" & TheirLine) to false
- --set icon of button ("c" & TheirLine) to 19001
- show button ("c" & TheirLine)
- end if
- end EnterUserCard
-
-
-
- -- Test if we are shared Stack, or a User stack
- on AreWeRoot
- if background field "Which One" is "Shared" then
- return true
- else
- return false
- end if
- end AreWeRoot
-
-
- -- Keep the user stack relatively small
- on DeleteAllButThis
- put the id of this card into OurName
- repeat forever
- doMenu "Next"
- if the id of this card is OurName then exit repeat
- doMenu "Delete Card"
- end repeat
- end DeleteAllButThis
-
-
- on ClickInField
- global TheirLine
-
- set lockscreen to false
- if TheirLine > 0 and TheirLine < 11 then
-
- repeat 5 times -- oh bill, why do I need this?
- set lockscreen to false
- set locktext of background field ("b" & TheirLine) to false
- end repeat
-
- click at loc of background field ("b" & TheirLine)
- end if
- end ClickInField
-
-
- -- Insert BUTTON
- -- just insert this info, then try for another editable line
- on doInsert
-
- -- first check for illegal situation
- push card
- pop Card into CheckMe
- put word 6 to 100 of CheckMe into CheckMe
- if background field "Root Stack" is CheckMe then
- beep
- answer "Use a copy, not the root stack!" with "Restart"
- exit doInsert
- end if
-
- set lockscreen to true
- if AddNewEdited() is false then exit doInsert
- GetNewEditable
- ClickInField
- end doInsert
-
- on TabKey -- same as insert button, wish could get return as well
- set lockscreen to true
- if AddNewEdited() is false then exit TabKey
- GetNewEditable
- ClickInField
- end TabKey
-
-
-
- --
- -- pop up one level. if possible
- --
- on doToParent
- set lockscreen to true
- put word 2 of name of this card into CardName
- put char 2 to (length of CardName - 1) of CardName into CardName
- put length of CardName into NameL
- put character NameL of CardName into LastChar
- if CardName is not "Root" then
- if LastChar is "0" then -- ends in 10
- put char 1 to (NameL - 3) of CardName into CardName
- else
- put char 1 to (NameL - 2) of CardName into CardName
- end if
- end if
- if AddNewEdited() is false then exit doToParent
- go to Card CardName
- GetNewEditable
- ClickInField
- end doToParent
-
- on doToRoot
- set lockscreen to true
- if AddNewEdited() is false then exit doToRoot
- go to card "Root"
- GetNewEditable
- ClickInField
- end doToRoot
-
-
- --
- -- user clicked on one of fleet arrows
- --
- on ExploreLine WhichOne
- if AddNewEdited() is false then exit ExploreLine
- FollowArrow WhichOne
- GetNewEditable
- ClickInField
- end ExploreLine
-
-
- on FollowArrow WhichOne
-
- -- check if possible
- put background field "Root Topic" into RootTopic
- put background field ("b" & WhichOne) into NewTopic
- put background field "Root Stack" into RootStack
- put background field "Lock File" into LockFile
- if NewTopic is empty then
- beep
- exit FollowArrow
- end if
-
-
- put word 2 of (name of this card) into ParentName
- put char 2 to (length of ParentName - 1) of ParentName into ParentName
- put (ParentName & "-" & WhichOne) into NextCard
- -- already been there?
- if icon of button ("c" & WhichOne) is 22308 then
- go to card NextCard
- else
- set icon of button ("c" & WhichOne) to 22308
- -- New Card, but carry along foreground buttons
- doMenu "Copy Card"
- doMenu "Paste Card"
-
- set name of this card to NextCard
- put NextCard into background field "Card"
- put NewTopic into background field "Topic"
- put RootTopic into background field "Root Topic"
- put RootStack into background field "Root Stack"
- put LockFile into background field "Lock File"
- repeat with iter=1 to 10 -- everything is available
- set icon of button ("c" & iter) to 19002
- put empty into background field ("b" & iter)
- end repeat
- end if
- end FollowArrow
-
-
-
-
-
-
- --
- -- SPEW TO FILE
- --
- on CrankToFile
- push card
- go to stack (background field "Root Stack")
- go to card "Root"
- put PutFileName( (background field "Root Topic") & "--MOREΓäó format" ) into WhereTo
- if WhereTo is empty then exit CrankToFile
-
- open file WhereTo
- set lockscreen to true
- write "Idea Mapping, by PcG, " & the date to file WhereTo
- write return to file WhereTo
- RecurseDump WhereTo, 1
- close file WhereTo
- set lockscreen to false
-
- pop card
-
- answer "Now you can open MOREΓäó (or MacWrite) with the file "&WhereTo
- --if it is "Yes" then open WhereTo with "MOREΓäó V1.1"
- end CrankToFile
-
-
- -- dump this card out to the file
- on RecurseDump WhereTo, NumTabs
- -- plop out topic
- repeat for NumTabs
- write Tab to file WhereTo
- end repeat
- write background field "Topic" to file WhereTo
- write return to file WhereTo
-
- -- look at all fields
- repeat with TheField = 1 to 10
- if icon of button ("c" & TheField) is not 22308 then
- if background field ("b" & TheField) is not empty then
- repeat for NumTabs + 1
- write Tab to file WhereTo
- end repeat
- write background field ("b" & TheField) to file WhereTo
- write return to file WhereTo
- end if
- else
- -- find name of recursed to card
- put word 2 of name of this card into NewCard
- put char 2 to (length of NewCard - 1) of NewCard into NewCard
- put ( NewCard & "-" & TheField ) into NewCard
-
- -- recurse
- push card
- go to card NewCard
- RecurseDump WhereTo, NumTabs + 1
- pop card
- end if
- end repeat
-
- end RecurseDump
-
-
-
-
- --
- -- NEW STACK
- --
- on CreateNewStack
- ask "What is the new topic?"
- if it is empty then exit CreateNewStack
- put it into NewTopic
-
- DeleteAllButThis
- put "Root" into background field "Card"
- set the name of this card to "Root"
-
- repeat with WhichOne = 1 to 10
- put empty into background field ("b" & WhichOne)
- set locktext of background field ("b" & WhichOne) to true
- show button ("c" & WhichOne)
- set icon of button ("c" & WhichOne) to 19002
- end repeat
-
- put NewTopic into background field "Topic"
- put NewTopic into background field "Root Topic"
-
- push card
- pop Card into ThisCard
- put word 6 to 100 of ThisCard into ThisCard
- put ThisCard into background field "Root Stack"
- -- Now build "Lock File"
- put DirectoryOf( ThisCard ) into LockFileName
- put ( LockFileName & "Lock File" ) into LockFileName
- put LockFileName into background field "Lock File"
- open file LockFileName
- write "UNLOCKED" to file LockFileName
- close file LockFileName
-
- -- This card is all set for cloning now
- push card
-
- doMenu "Copy Card"
- doMenu "New Stack..."
-
- doMenu "Paste Card"
- DeleteAllButThis
-
- hide background button "New Stack"
- hide background button "Spew to File"
- set the name of this card to "Only One"
-
- pop card
-
-
- answer "Clone this new stack to all users"
-
- end CreateNewStack
-
-
-
- function DirectoryOf FullPath
- repeat forever
- if ( char (length of FullPath) of FullPath ) is ":" then
- return FullPath
- end if
- put char 1 to (length of FullPath - 1) of FullPath into FullPath
- end repeat
- return "Bad Path Name:" -- will cause error
- end DirectoryOf
-
-
-
-
- -- test FileLockP robustness
- on Testing -- loop through attempted file locking/releases
- repeat forever
- put "Look for FileServer" into Msg
- put GetThere() into foo
- if foo is true then
- put "GotThere" into Msg
- wait (60 + the Random of 120)
- ReleaseLock
- put "Released, now wait" into Msg
- else
- answer "Missed" with "AAARGGHHH"
- --put "MISSED" into Msg
- end if
-
- wait (60 + the Random of 300)
- end repeat
- end Testing
-
-
-
-