[comp.sys.mac.hypercard] Hypercard questions + suggestions

pff@beach.cis.ufl.edu (Pablo Fernicola) (04/07/89)

Let me start with the questions:

1- Can I define my own event? I thought I read that in one of the hypercard
books but I can't find it again ( I usually read after midnight, so I probably
dreamt it up :-)).

2- Inside a XFCN (written in C) are there any special considerations regarding 
the use of NewHandle & DisposHandle?  Could I use malloc(), or calloc()? (I
still get confused by Handle stuff, specially in relation to an array of
structures, with each structure containing a 2D array of strings).

3- If a have a variable Var and it contains mem1 and mem2, given by 
		put "mem1,mem2" into Var
how can I do the following,

	"put the value of item 1 of Var into the value of item 2 of Var"
	
so if mem1 had "hello" to start with and mem2 was empty, after doing the
line above, mem2 would contain "hello".  I tried placing mem2 in target, but 
it didn't work.  I also tried "put item 2 of Var into the target" and it 
didn't work.

Wish List:

1- User definable events, ie. 

on myEvent
	do stuff
	pass myEvent
end myEvent

2- Broadcast capabilities, to pass an event to other objects (buttons and
fields) at the same level or higher, ie.

on myEvent
	do stuff
	broadcast myEvent
	pass myEvent --maybe broadcast acts only at the same level
end myevent

3- A way to use a more resourceful editor to write scripts.


I would like to end by expressing my great admiration for the people that
developed Hypercard and those that are working on improving it.  Thanks!
--
Pablo Fernicola			pff@beach.cis.ufl.edu
Machine Intelligence Laboratory
University of Florida
Disclaimer: The above opinions belong only to me.

englandr@phoenix.Princeton.EDU (Scott Englander) (04/08/89)

In article <20013@uflorida.cis.ufl.EDU> pff@beach.cis.ufl.edu (Pablo Fernicola) writes:
>3- If a have a variable Var and it contains mem1 and mem2, given by 
>		put "mem1,mem2" into Var
The above statement will put the literal string in quotes into the Var.
But you don't need to do this to reserve space.

>how can I do the following,
>	"put the value of item 1 of Var into the value of item 2 of Var"
>	
>so if mem1 had "hello" to start with and mem2 was empty, after doing the
>line above, mem2 would contain "hello".  I tried placing mem2 in target, but 
>it didn't work.  I also tried "put item 2 of Var into the target" and it 
One way is:
put item 1 of var into item 2 of var

Even if item 2 didn't exist before, it will now, and if item one was
999, var will now look like

999,999

>1- User definable events, ie. 
>
>on myEvent
>	do stuff
>	pass myEvent
>end myEvent
>
This is already a feature.  Try it by putting this handler into your
background script and then "send myEvent to [whatever]", where
[whatever] is some object below the background in the hierarchy (like
the card or a button).  Or you could just "send myEvent to background
1".
-- 

                                               - Scott