Array of enum -> Internal error: System.NullReferenceException: Object reference not set to an instance of an object

Fire 2401 build

interface

type
  TPosTerminal = public partial class(RemObjects.SDK.Types.ComplexType)
  private
  protected
  public
    function doLoadSequence(ActiveSequence: TSecuenciaTerminal): array of TPasosSecuenciaTerminal;
  end;

implementation

function TPosTerminal.doLoadSequence(ActiveSequence: TSecuenciaTerminal): array of TPasosSecuenciaTerminal;
begin

Internal error: System.NullReferenceException: Object reference not set to an instance of an object

project sent via PM

Thanks, logged as bugs://82562

Got it; it fails on this:

result :=+ […];

in
ClassesPosTerminal_Sequences.pas line 456.

this will fail properly in the next version.

Is a invalid sentence?

Im try to add new content to an array.

result := [
TPasosSecuenciaTerminal.Some,
TPasosSecuenciaTerminal.SomeMore];

result :=+ [
TPasosSecuenciaTerminal.SomeMorePlus,
TPasosSecuenciaTerminal.SomeMorePlusPlus];

Is valid? Must work?

What’s :=+ supposed to be?

result := result + […]; :thinking:

That’s not valid pascal syntax though!?

No. I think see some like that in Oxygene documents. What more can I say? Theres a lot off improvements in Oxygene I trust is supported. My bad.

If we’d ever support this, it’d be +=, as we already sue that for events, not :=+ :wink:

Thanks my friend for your patience. Im in process of migrate a very bog Delphi server to Oxygene. I fairly know which is my name right now. :face_with_head_bandage:

1 Like

Does Delphi do :=+? surely not, as they haven’t really added a new language feature since around Delphi 7, iirc…

No Marc, that code have to be changed at complete because the intf file generated for a rodl in Delphi for arrays use TROArrays and in dot net use array of item.

Not related to at all, but you are wrong. Ask Evgeny. Im sure he can tell you all new languages feature added in Rio. BTW, I have no idea why are we talking of this? Maybe you can help me with migration of this DA code to Oxygene?

var
  lConnection : IDAConnection;
  lQuery      : IDADataset;
  dw          : TDAWhereBuilder;
begin
  try
    lConnection := ServerDataModule.ConnectionManager.NewConnection(fDBConexion);
    if not lConnection.InTransaction then lConnection.BeginTransaction;
    lQuery        := SchemaGetDataset(lConnection, ServerDataModule.Schema, 'TABLA');
    dw            := lQuery.DynamicWhere;
    dw.Expression := dw.NewBinaryExpression('', 'IDTABLA',  dboEqual, 100);
    lQuery.Active := True;
    result  := lQuery.FieldByName('NAME').AsString;
    if lConnection.InTransaction then lConnection.CommitTransaction;
  except
    on e:exception do
    begin
      if lConnection.InTransaction then lConnection.RollbackTransaction;
    end;
  end;
end;

Best regards.

bugs://82562 got closed with status fixed.