curiosities in object reference

Mark Schonewille m.schonewille at economy-x-talk.com
Sun Apr 19 16:38:13 EDT 2015


Hi Pete,

Can you use the short id?

put the short id of fld "text" into x
put "deux" into word 2 of fld x

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Installer Maker for LiveCode:
http://qery.us/468

Buy my new book "Programming LiveCode for the Real Beginner" 
http://qery.us/3fi

LiveCode on Facebook:
https://www.facebook.com/groups/runrev/

On 4/19/2015 22:20, Peter M. Brigham wrote:
> So I have a field, let's say field "text", with the contents "one two three four".
>
> if I do this:
>     put the long id of fld "text" into fRef
>     put "deux" into word 2 of fRef
>
> it puts "deux" into word 2 of "field id 1022 of stack…" and doesn't resolve fRef as a field reference.
>
> But if I do:
>     put the text of fRef into tText
>
> it *does* resolve fRef as a field reference, as I would expect. It appears that the engine only resolves these references when the context/syntax indicates that it should expect an object reference, and not otherwise.
>
> Is there any way I can put "deux" into word 2 of the field without jumping through hoops, like
>     put "deux" into newWord
>     do "put newWord into word two of" && fRef
> ??
>
> I don't want to do:
>     put the text of fRef into tText
>     put "deux" into word 2 of tText
>     set the text of fRef to tText
> because the field may contain formatted text that I want to preserve.
>
> ideas? or am I stuck with hoops?
>
> -- Peter
>




More information about the use-livecode mailing list