Type RemObjects.Oxygene.System.Word?

Finally figured out that some Oxidized Delphi code using type ‘Word’ was malfunctioning. That is, simple arithmetic comparisons were failing. I tried to isolate this to a simple test case and can’t create a variable of type ‘Word’. Even RemObjects.Oxygene.System.Word is ‘unknown’, however my large project compiles fine with type ‘Word’, it simple doesn’t run properly.

I thought perhaps Word was only allowed is Oxidizing Delphi code, so I created the procedure testWordArithmetic shown below and Oxidized it into the tiny_hello_world example as follows, but it will not compile:

namespace hello_world;

interface

type
  ConsoleApp = class
  public
    class method Main(args : array of String);
  end;

implementation

class method ConsoleApp.Main(args : array of String);
var 
  myLine:String;
  bX, bWidth: Integer;
begin
  writeLn('Hello World!');  
  //Console.ReadLine; 
  System.in.read;
end;

// namespace expected
procedure testWordArithmetic;
var
  a,b : RemObjects.Oxygene.System.Word;
  
begin
  a := 80;
  b := 10;
  
  if b >= a then
    b := a-1
  else
    b := 0;
  writeLn('b='+b);
end;

end. 

I’d really like to understand this.

You need to reference com.remobjects.elements.rtl.jar, to use unsigned types on Java, as these are not supported by the Java platform itself. We’ll fix the project templates(s) to automatically reference this by default, for the next release.

thanx,
marc

Thanks, logged as bugs://71330

That’s not all there is to it. I added the rtl.jar as a reference and ran the following test case. It shows ‘b=79’ indicating that the comparison if b >= a was treated as true, rather than false.

[code]namespace hello_world;

interface

type
ConsoleApp = class
public
class method Main(args : array of String);
end;

implementation

class method ConsoleApp.Main(args : array of String);
var
myLine:String;
bX, bWidth: Integer;
begin
testWordArithmetic;
writeLn(‘Hello World!’);
//Console.ReadLine;
System.in.read;
end;

// namespace expected
procedure testWordArithmetic;
var
a,b : RemObjects.Oxygene.System.Word;

begin
a := 80;
b := 10;

if b >= a then
b := a-1
else
b := 0;
writeLn(‘b=’+b);
end;

end. [/code]

Yeah this is already fixed internally and in the last few betas. Do you have access to the beta?

Not that I’m aware of. I would like that access.

Are you using the trial or full? Full users can always access the beta on https://secure.remobjects.com/

Full license. Thanks for the pointer to the alpha/beta builds.

1 Like

bugs://71330 got closed with status fixed.