remobjects / pascalscript

pascalscript
Other
447 stars 178 forks source link

Pass var array of byte Type mismatch #263

Open breitsch2 opened 1 year ago

breitsch2 commented 1 year ago

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);

Alekcvp commented 1 year ago

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).

maxkleiner commented 3 days ago

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