variables by reference - script style suggestion
Rodney Tamblyn
rodneytamblyn at paradise.net.nz
Thu Sep 4 06:35:01 EDT 2003
I find it useful to indicate in the handler name (by appending "V")
when it uses variables by reference. Alternatively you could
prepend/append the "v" to the variable name if you prefer. My eye
scans the handler names faster than the variables so I find it better
this way.
Eg:
on mouseUp
local tFocus
maeGetDocFocusV tFocus #V indicates function uses variables by
reference
answer tFocus #hello
end mouseup
is equivalent to
on mouseUp
local tFocus
put maeGetDocFocus() into tFocus
answer tFocus #hello
end mouseup
#here are the function handlers...
on maeGetDocFocusV @pDoc
put maeGetDocFocus() into pDoc
end maeGetDocFocusV
function maeGetDocFocus
return "hello"
end maeGetDocFocus
--
Rodney Tamblyn
44 Melville Street
Dunedin
New Zealand
+64 3 4778606
http://rodney.weblogs.com/
More information about the use-livecode
mailing list