Unable to modify object property

I have a Text Display Object named “1Dashboard” in a form. It has a background colour of 0000FF (Blue). When I run a procedure which contains only the code below, the background colour of the object does not change.

let ObNam = "1Dashboard"
object ObNam
changeobjects "$TextBackgroundFill","FFA500" 

If I replace the object statement with this:

selectobjects objectinfo("name") contains "dashboard"

… the procedure changes the background colour correctly.

Why is that?

I’m not sure why that code is not working for you. However, the object statement is really obsolete at this point. I would suggest that you use this code:

changeobject "1Dashboard","$TextBackgroundFill","FFA500"

Obsolete? I suspect it’s moribund. I’ll post an addendum to the documentation.

OK, this code doesn’t work either:

let ObNam = "1Dashboard"
changeobject ObNam,"$TextBackgroundFill","FFA500"

I’m sticking with selectobjects and changeobjects.

Are you sure you have the right name for the object? When I tried it, it worked perfectly. I notice that when you use selectobjects, you are using contains, and only a portion of the name. It could be that the full name differs slightly in spelling or case, from the name that you are using. Perhaps the full name contains a space at the beginning or end.

You are right as always Dave. In amongst my fiddling about I had altered the name of the object. Trying to move too quickly.