Posted October 3, 201014 yr How to I create a variable in the statement(between the begin and end;) instead of before the statement? I don't want to waste a lot unused array. I want the program to be able to change the no. of array during runtime.
October 3, 201014 yr Ok, then use dynamic arrays.procedure YourProcedure;var MyDynamicArray : array of Integer;begin SetLength(MyDynamicArray,100); // This allocates dynamically memory for your array .... // some operations with the array .... .... SetLength(MyDynamicArray,0); // Now you haven't any allocated memory for the array .... ....end;Best regardsNacho_dj
Create an account or sign in to comment