Background:
I have two forms. An array is created on form1 and it needs to get passed to form2 for procedureX. The array is an array of array of string and is dynamic. The array is used in procedureX and then passed back out. Decleared like the following:
procedure ProcedureX (var multidimensionalarray:array of array of string);
Error:
I know this is going to bring an error because you can't pass multidimensional arrays. The error you get is: E2029 Identifier expected but 'Array' found. From this website: https://blog.spreendigital.de/2016/08/01/pass-a-multidimensional-array-as-a-parameter-with-a-hidden-caveat/ I know you need to create a type.
But I have questions because of the background of my problem: - would I create the type in form1 or form2? - how do you pass a type between forms?
I don't have any code yet because I have no idea where to start. I new to the code and don't really know where to look. I understand this question has been asked many times however because my procedure is on one form and my array on another, I do not know what to do.
MyTypes.pas) and add it to your form units'usesclause to be able to use them (uses ..., MyTypes;).TArray<TArray<string>>