Bug with public variables?

Former Member
Former Member
I got started with MonkeyC this weekend, and was able to write a small app without too much trouble.

But I believe I found one bug in the language, which I'll try to describe here:

I started with a custom Drawable that has one public variable (field? member? pick your terminology): [FONT=courier new]class ScoreDisplay extends Ui.Drawable {
function draw(dc) { }
public var gameScore;
}[/FONT]


And in my View, I try to set that score: [FONT=courier new]function onUpdate(dc)
{
// This fails
View.findDrawableById("MyGameScore").gameScore = 100;

// This works:
var temp = View.findDrawableById("MyGameScore");
temp.gameScore = 100;

// This would also work:
View.findDrawableById("MyGameScore").setGameScore(100);
}[/FONT]


(I don't remember the exact error message. I'll try to update with that info later)

As best I can tell, the first line should be perfectly valid.


Some other minor nitpicks I found:
  • In the Programmers Guide, there is a table of operators and precedence. But the ++ and -- operators aren't listed.
  • In the Programmers Guide (installed with the SDK, not the online version), there are examples that have[FONT=courier new] ( : property )
  • [/FONT]before certain members, but I couldn't find any explanation.


  • For the one that fails, what's the error message you see?
    Which version of the SDK as far as the doc? The production one right now is 2.4.5, but there's also a 3.0.0 beta1.

    Ok, in 2.4.5 I see the property annotation in the section on Selectables, and may just be from the actual source for that class, where annotations can be used to include/exclude things, or to define things like something is available to a background process. Check out the section on annotations.
  • Former Member
    Former Member
    For the one that fails, what's the error message you see?
    Which version of the SDK as far as the doc? The production one right now is 2.4.5, but there's also a 3.0.0 beta1.


    The SDK version is 2.4.5.
    I don't remember the error message (I'm at the office now, and the error is on my home computer), but I'll try to update that info later today.
  • Hi abelenky, thanks for your post. This is a limitation of our grammar that we were previously aware of - an open ticket already exists and we will try to let you know as soon as it is resolved.