curiosities in object reference
Peter Haworth
pete at lcsql.com
Sun Apr 19 16:54:43 EDT 2015
The problem is "word" is a valid reference to a variable and that may be
what you want to do. I can't remember what I've tried to get round this but
pretty sure I've always ended up using a do command.
Pete
lcSQL Software
On Apr 19, 2015 1:21 PM, "Peter M. Brigham" <pmbrig at gmail.com> 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
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list