control references

Ivers, Doug E Doug_Ivers at lord.com
Sat Jun 22 08:22:01 CDT 2002


Does Rev. only have one data type:  text?   Is  'put 3 into T'  any different than  'put "3" into T' ?  Regardless of the answer to this, I have a suggestion....

Seems to me that Rev. would benefit from a special variable type that points to Rev. objects.  I frequenty find I'm coding goofy work-arounds such as  do "..." whenever I pass a reference to a control into a handler.  This is because variables can only hold text.

In other words, when I put "field 2" into a variable, Rev. doesn't know (because I have no way of telling it) whether I want this to mean a text string of 7 characters or a reference to the field object.  What I would like to say is  'put object field 2 into theField'  so that I can later say  'put "whatever" into theField'  and it would change the text of the object field 2.  Don't you think this would enable us to write cleaner code?

Alternatively, if it would be more consistent with xTalk conventions, then perhaps a function could be provided that forces the interpretation of a text string as an object reference.  This would be analogous to the conversion that value("5") does to create an integer.


Here's a code snippet that I'm currently working on:

on equalizeNlines f1, f2
-- f1 and f2 are any valid field references
-- note that I want to be able to pass in short name, ID, or number or long name, ID, or number
if exists(f1) and exists(f2) then
put value(f1) into f1Text  -- slightly goofy
put value(f2) into f2Text  -- slightly goofy
...
...
do "put f1Text into "& f1   -- very goofy  -- wish for:  put f1Text into object(f1)
do "put f1Text into "& f2   -- very goofy  -- wish for:  put f2Text into object(f2)



-- D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20020622/b32f4486/attachment.html>


More information about the use-livecode mailing list