open-array-parameters

Why casting an open array parameter to an array type causes E2089 Invalid typecast?

和自甴很熟 提交于 2020-02-24 00:34:13
问题 I'm using Delphi 2007 (Pre generics) and I've defined many functions who can be used for all arrays of TObject 's descendants, example: function IndexOf(AArray : array of TObject; AItem : TObject) : integer; begin //... end; For passing them dynamic arrays of TObject 's descendants, I've defined an array type TObjectArray = array of TObject . In this way I can cast dynamic arrays and pass them to my functions without any problems: type TChild = class(TObject); ... procedure Test(); var Items

An Oracle stored procedure accept array(table) parameter in package example needed

别说谁变了你拦得住时间么 提交于 2019-12-25 04:03:42
问题 This question is a part of my question how to pass javascript array to oracle store procedure by ado parameter object I think divide it to 3 small parts will get answer faster. For this question. I know we can declare a table type and use select last_name from employees in (select * from table(cast(my_table_type_var as my_table_type)); but I always get error from create new package which include a procedure has this. and I read some thread said I need to declear a sql(in schema) type because

Is a dynamic array of Char allowed when the parameter type is open array of Char?

…衆ロ難τιáo~ 提交于 2019-11-29 12:37:19
问题 I was looking at Delphi: array of Char and TCharArray "Incompatible Types" and started experimenting. What I discovered is rather interesting. procedure Clear(AArray: array of Integer); var I: Integer; begin for I := Low(AArray) to High(AArray) do AArray[I] := 0; end; var MyArray: array of Integer; begin Clear(MyArray); end. This simple little example shows how you can pass a Dynamic Array to a procedure using an Open Array parameter. It compiles and runs exactly as expected. procedure Clear