Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!uwvax!umn-d-ub!umn-cs!hyper!mark
From: mark@hyper.UUCP (Mark Mendel)
Newsgroups: comp.sys.mac
Subject: Some HyperText tricks
Message-ID: <687@hyper.UUCP>
Date: Wed, 25-Nov-87 16:14:58 EST
Article-I.D.: hyper.687
Posted: Wed Nov 25 16:14:58 1987
Date-Received: Sun, 29-Nov-87 11:28:04 EST
Organization: Network Systems Corp., Mpls. MN
Lines: 54

Here are a couple of short, usefull tricks.


1. The q() function: a solution to "& quote &" proliferation

function q
   put quote & param(1) & quote into theResult
   repeat for i = 2 to the paramCount
       put comma & quote & param(i) & quote after theResult
   end repeat
   return theResult
end q

This little function can shorten your scripts considerably, if you use 
the "send" or "do" command at all.  Search for "quote" and "comma" in 
your scripts and try rewriting the line using q().  For example,

	do cmd && quote & arg1 & quote & comma & quote & (v1+v2) & quote 
		& ",constant"

translates to

	do cmd && q(arg1,v1+v2,"constant")

2. Radio button handling.

on radioClick fieldName
    -- Each button in a radio button set calls radioClick on mouseUp
    -- events. [Not mouseUp, at least Apple does it that way].
    --  is the
    -- short name of a background field that will always contain the short
    -- name of the selected button.  
    -- the radio buttons should be background buttons.

    set the hilite of bkgnd button (field fieldName) to false
    set the hilite of the target to true
    put value(short name of the target) into field fieldName
end radioClick

on radioInit
    -- Usage: radioInit ,