Why does Oxygen for Java complain about multi-dimensional arrays when I don't think I am using them?

I have this code in Oxygene for Java:

  GameApplication = public class
  private
    const cScreenWidth  = 800;
    const cScreenHeight = 600;
    const cTileWidth    = 24;
    const cTileHeight   = 24;

    cAmmoAir            = 0;
    cAmmoWater          = 1;
    cAmmoFire           = 2;
    cAmmo               = 3;

    var
    FScreenWidth   : Integer;
    FScreenHeight  : Integer;
    FLevel         : GameLevel;
    FAppRunning    : Boolean;

    FPlayerX       : Single;  // x position
    FPlayerY       : Single;  // y position
    FPlayerVX      : Single;  // x velocity position
    FPlayerVY      : Single;  // y velocity position
    FPlayerRadius  : Single;  // player radius
    FPlayerAngle   : Single;  // player rotation angle
    FPlayerFlying  : Boolean; // true if player is flying in air using boosters
    FPlayerFalling : Boolean; // true if player is in air but not using boosters
    FPlayerAmmo    : array[0..3] of Integer;

    method GetTime: Integer;

    method InitGame;
    method CleanupGame;
    method InitGL;

    method CreateIslandAt(aX,aY,aWidth,aHeight: Integer; aTheme: Integer);

    method RenderTile_Ground(aTile: GameTile; aX,aY: Single);
    method RenderFrame(aFrameTime: Single);
    method UpdateFrame(aFrameTime: Single);
    method UpdateInput(aFrameTime: Single);
  public
    method Run();
    class method main(argv: array of String);
  end;

The line

FPlayerAmmo    : array[0..3] of Integer;
line looks like a single dimensional array to me, but the compiler is giving this error:
Error	1	(JE19) Multidimensional arrays are not supported for Java	C:\Users\paul.nicholls\Dropbox\Oxygene for java\projects\platformation\platformation\game_main.pas	40	22	platformation

Why is this?

PS. I am getting annoyed that the online documentation (http://wiki.oxygenelanguage.com) about the Oxygene language seems to mostly be for .NET and not Java…the compiler is complaining about various bits of code that are valid according to the site, but not by the Oxygene for Java compiler! :frowning:

Some notable examples are records (not supported by Java) and multi-dimensional arrays (not supported by Java), but these are plainly in the online documentation!!

Any idea when the wiki is going to be updated for Oxygene for Java too? :slight_smile:

cheers,
Paul

What cooper are you using? Pretty sure recent betas work with 0 based arrays like that (1 based don’t work). As for the wiki, you are right, we’re going to update that soon.

I’m using the current trial version (5.0.31.991) - I am writing a game for a Pascal programming competition :slight_smile:
http://www.pascalgamedevelopment.com/content.php?329-2nd-PGD-Challenge-The-Journey

Oh, it also still mentions Everwood in my Oxygene for Java, version 3.0.27.333
if it helps?

I was a beta tester a month or so back…

here is the full text copied from the About Box in Oxygene:

Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel

Installed Version: IDE Standard

Microsoft Visual Web Developer 2010   01011-532-2002361-70605
Microsoft Visual Web Developer 2010

RemObjects Everwood   3.0.27.333
RemObjects Everwood for .NET
Copyright 2003-2011 RemObjects Software, LLC. All rights reserved.
http://www.remobjects.com/everwood

RemObjects Oxygene   5.0.31.991
RemObjects Oxygene
Copyright 2003-2012 RemObjects Software, LLC. All rights reserved.
http://www.remobjects.com/oxygene
http://www.theoxygenelanguage.com

Security Update for Visual Studio 2010 Shell (Integrated) - ENU (KB2251489)   KB2251489
This security update is for Visual Studio 2010 Shell (Integrated) - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2251489.

Security Update for Visual Studio 2010 Shell (Integrated) - ENU (KB2644980)   KB2644980
This security update is for Visual Studio 2010 Shell (Integrated) - ENU.
If you later install a more recent service pack, this security update will be uninstalled automatically.
For more information, visit http://support.microsoft.com/kb/2644980.

That looks rather like 54376 - I think that was fixed in a build since .991

That looks rather like 54376 - I think that was fixed in a build since .991

drat! LOL

It’s easily work-round-able

I had:

gravity: array[0…2] of Single; -> FAIL

and had to use:

gravity: array of Single := new Single[3]; -> w00t

Throw some conditional compilation around it, and you can revert to sensible declarations as and when the trial is updated

It's easily work-round-able

I had:

gravity: array[0…2] of Single; → FAIL

and had to use:

gravity: array of Single := new Single[3]; → w00t

Thanks, I will try this :slight_smile: