ric@islenet.UUCP (Frederick Lee) (02/08/88)
I'm trying to link a "mastercard" with its detail/memo card using hypertalk, for each new mastercard created. Manually creating a hard link is straight- forward and I wish to emulate that using HyperTalk. The end result should be a detailed button that the user clicks to get to the particular detailed card. I've tried popping the card ID into a variable and going to that card via "go card thisCard". But this HyperCard gives the "...unable to locate.." alert. The master & detail cards are in the same stack but with different backgrounds. What I really like to do is emulate the Link option via HyperTalk. Question: How do I use HyperTalk to hard-Link to another card within the same stack (with different backgrounds)? -- Thanks in Advance. Ric @ islenet.UUCP P.S. A new Detailed Card is created for each new Master Card.
mab@batcomputer.tn.cornell.edu (Mark Bodenstein) (02/14/88)
>Question: How do I use HyperTalk to hard-Link to another card within the same > stack (with different backgrounds)? It sounds like you were close, but left out the word "short". To spell it out: In the script that creates the detail card: At the detail card: put short id of this card into temp Back at the card from which you want to link: put temp into field detailCardId In the mouseUp handler of the "detail" button: get field detailCardId if it is not empty then go card id it Hope this helps. -- Mark Bodenstein {ihnp4,rochester}!cornell!batcomputer!mab mab@batcomputer.tn.cornell.edu
aisl@ur-tut.UUCP (Larry Landry) (02/15/88)
In article <3856@islenet.UUCP> ric@islenet.UUCP (Frederick Lee) writes: >I'm trying to link a "mastercard" with its detail/memo card using hypertalk, >for each new mastercard created. > >The master & detail cards are in the same stack but with different backgrounds. > >Question: How do I use HyperTalk to hard-Link to another card within the same > stack (with different backgrounds)? > Try the following: 1) When you create a new master (and detail) card give them both the same name. (set the name of this card to "whatever") 2) The script of your button then becomes one line go card (the name of this card) of bkgnd "otherBackground" You could also save the ID of the other card and replace the name with the ID as you seem to be trying now. The important part is to specify which background to look at. Larry Landry
john@felix.UUCP (John Gilbert) (02/17/88)
In article <3856@islenet.UUCP> ric@islenet.UUCP (Frederick Lee) writes: >I'm trying to link a "mastercard" with its detail/memo card using hypertalk, >for each new mastercard created. Manually creating a hard link is straight- >forward and I wish to emulate that using HyperTalk. > >The end result should be a detailed button that the user clicks to get to >the particular detailed card. > >I've tried popping the card ID into a variable and going to that card via >"go card thisCard". But this HyperCard gives the "...unable to locate.." >alert. > >P.S. A new Detailed Card is created for each new Master Card. Well, there are several way to address a card from HyperTalk, and being the "friendly" language that it is, the syntax is not real rigid... You can say (among other more explicit things)... go card 3 This example goes to the third card in the stack, relative to the sorted order of the cards. Changing the order of the cards will change the result. Apparently the fastest way to go to a card, all other things being equal. go card id 3 This will always go to the same card as long as cards are not deleted (and maybe even if they are ... not sure). The card ID is assigned when the card is created, and remains constant. Finding the card is a bit slower this way. go card "foo" If you name your cards, and the names are unique, then this is generally the most reliable way (I think). About the same as using 'card id 3', maybe a bit slower. Something interesting to note, you will have problems if you want to name your cards with numbers. The command ' go card "3" ', will go to card NUMBER 3, not a card with the name "3". Now the interesting thing about HyperCard is that the way you used it: >"go card thisCard". But this HyperCard gives the "...unable to locate.." ... it all depends on what you have in 'thisCard'. If it contains "card id 3", than this is different than "3", and you would want to say go theCard. The following script, tho maybe unnecessary, should work for any legitimate card identifier: on mouseUp put field "detail card" into thisCard if word 1 of thisCard is "card" then go thisCard -- handles long card IDs else go card thisCard -- handles card names, numbers if the result is not empty then go card id thisCard -- handles short card IDs end if end if if the result is not empty then answer "Somebody goofed somewhere!" -- particularly helpful error message end if end mouseUp This assumes you have the identifier stored in a background field called "detail card". You can do this, or, if the you really want, the button in question could be a card button with a specialized script of it's own. But, this is a different topic. If you intend to use card ID's, then you may be having trouble if you have "card id 3" in thisCard, and you are saying "go card thisCard". This needs to be "go thisCard". If thisCard contains "3", then you need to explicitly differentiate between a card ID and a card NUMBER with either: "go card id thisCard", or "go card thisCard" respectively. John Gilbert -- John Gilbert !trwrb!felix!john