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

(DonaldShimoda) #1

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

(RemObjects) #2

Thanks, logged as bugs://82562

(Carlo Kok) #3

Got it; it fails on this:

result :=+ […];

in
ClassesPosTerminal_Sequences.pas line 456.

this will fail properly in the next version.

(DonaldShimoda) #4

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?

(marc hoffman) #5

What’s :=+ supposed to be?

(DonaldShimoda) #6

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

(marc hoffman) #7

That’s not valid pascal syntax though!?

(DonaldShimoda) #8

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.

(marc hoffman) #9

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

(DonaldShimoda) #10

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
(marc hoffman) #11

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

(DonaldShimoda) #12

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.

(RemObjects) #13

bugs://82562 got closed with status fixed.