Learning about GLOBALS late in life . . .

Mark Wieder mwieder at ahsoftware.net
Mon Nov 16 12:22:14 EST 2009


Richmond-

Monday, November 16, 2009, 9:00:46 AM, Colin wrote:

> top. So this would work for example:

> global t

...but do you really want to do that? This would also work...

local LEFTT, TOPP

on mouseDown
   put the top of fld "acre" into TOPP
   put the left of fld "acre" into LEFTT
   grab me
   end mouseDown

on mouseUp
   put the bottom of fld "acre" into DOWP
   put the right of fld "acre" into RITE
   put RITE - LEFTT into WIDD
   put DOWP - TOPP into HITE
end mouseUp

...without the drawback of having LEFTT and TOPP sitting around in
memory until you close the IDE and possibly interfering with variables
in other stacks.

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list