[comp.sys.mac.hypercard] closeField emulator

cs2531as@charon.unm.edu (Andrew Stone) (03/01/88)

	Hi. A voracious comp.sys.mac.* reader, I could not help but 
notice the monthly return of "closefield message not sent" gripe.

Maybe, Apple's own kludge from Technical Note #169 will be of interest:

If you have to have a closeField message for error handling or whatever,
try adding these scripts to the specified targets:

card script:	on openCard
		  global myField

		  put bkgnd field 1 into myField
		end openCard

Field script:	on closeField
		  global myField

		  put bkgnd field 1 into myField
		end closeField

Button script:	on mouseDown -- or mouseUp Let's assume this is bckgnd button 2 
		  global myField 

		  if myField is not bkgnd field 1 then]  --option return
		    send closeField to bckgnd field 1
		end mouseDown

"Then, when the user edits bkgnd field 1 and then clicks on bckgnd button 2,
HC will send the closeField message to bckgnd field 1 if and only if the 
user has changed its contents and the closeField message has not already 
been sent."

BTW-- have we decided which char to use for option-return (soft return)?
	"]" kind of looks like it.


	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	|	Andrew Stone     GEnie:ASTONE      505-345-4800		|
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	|      	"Science is a fable made consistent" - Edward Teller	|
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^