remobjects/pascalscript

Pass var array of byte Type mismatch

breitsch2 opened this issue · 2 comments

Registered a method
RegisterMethod('Procedure Compute( var pInput : array of byte)');
RegisterMethod(@TNNetFullConnect.Compute, 'Compute');
and in script call we got a type mismatch
BAInput: array of byte;
NN.Compute(BAInput);

Declare a type (if it doesn't exist yet):

type
  TBytes = array of Byte;

and use it for your parameters and variables. The "array of" expression has different meanings when defining a function and a variable (same as in delphi).

Right with RegisterMethod('Procedure Compute( var pInput : TBytes)'); explicitly it works, thanks.