Message Sending Problems

Klaus Major klaus at major-k.de
Thu Apr 14 06:08:39 EDT 2005


Hi David,

> Hi All,
>
> I am trying to write some generic code to send "Increment" events to 
> another object. This works ok:
>
> send "Increment 1" to graphic the cPropTargetObjectName of me
> however to make it more general I would like to be able to have the 
> type soft coded, to be able to write
>
> put "graphic" into myType
> send "Increment 1" to myType the cPropTargetObjectName of me
>
> So I looked around and found the "do" command, and did this:
> put "graphic" into myType
> put "send Increment 1" && myType &&  the cPropTargetObjectName of me 
> into myDoText
> do myDoText
>
> But this results in the following error:
> Object: value is not a boolean
> Object: Arrows
> Line: do myDoText
> Hint: 1
>
> I have checked the text in myDoText and it's fine and reads:
>
> send Increment 1 to graphic "G-1027"
>
> I don't understand why I am getting this error? Any ideas anyone?

Hmmm, maybe you need to put quotes around the command to be sent?

put "send" && QUOTE & "Increment 1" & QUOTE & ...

At least worth a try... :-)

> Also how can I get the type of an object?
> Is there a property for it? I can't seem to find one!

Try:

word 1 of the name of control x
## where x = the numer or the name of the control...

-> field "Field 1"
-> button id 1004
-> scrollbar "mySC"
...

Hope that helps...

> Thanks in advance
> Dave

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list