Object Reference in Variable?

Ken Ray kray at sonsothunder.com
Fri Sep 26 11:29:06 EDT 2008


>   put the number of lines of value(tField)
> 
> Rev refuses to compile this:
> 
>   delete line 2 of value(tField)
> 
> Error reads: Commands: missing ','
> 
> Any idea why?

Well, I'm assuming it's thinking that you want to evaluate the expression
"tField" using some other object (the second optional parameter to the
value() function). Not sure why it thinks that.

As to why it doesn't work, my guess would be that "value(tField)" doesn't
actually put the text into a variable container, so attempting to delete
line 2 of a non-existent container returns an error.

I checked this with the original:

  put the number of lines of value(tFIeld)

If I change that to:

   put the number of lines of value(tField) into tNum
   put tNum & "/" & it

I get:

   3/it

in the message box. So executing value(tField) doesn't affect "it" it seems.

BTW: Similarly you can't compile a script with:

  delete line 2 of (the text of tField)

without an error...

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list