Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.dal.ca!dal1!ireland From: ireland@ac.dal.ca Newsgroups: comp.sys.mac.hypercard Subject: Re: Scripting Question Message-ID: <3740@ac.dal.ca> Date: 22 Feb 91 19:44:24 GMT References: <13258@hubcap.clemson.edu> Lines: 25 Organisation: Dalhousie University, Halifax, Nova Scotia, Canada In article <13258@hubcap.clemson.edu>, jcocon@hubcap.clemson.edu (james c oconnor) writes: > I want a button to disappear when a field is empty and appear the > instant a user types a character into it. My code looks like this: > > on keyDown theParm > send "keyDown" && theParm to this card > if me is empty then > hide card button "button" > else > show card button "button" > end if > end keyDown > > It works fine, except when the user types a space. Then the message > gets confused. What gets passed is probably "keyDown " and the second > space isn't interpreted as the key. Is there a good way around this? > I'd like to avoid any hacks. > > Jim You could convert theParm to its ascii equivalent with chartonum(theParm). I had to do this in a keydown handler in order to distinguish upper and lower case letters. Hope this helps, Keith Conover. ireland@ac.dal.ca