iLuvCoding92 Posted October 3, 2010 Posted October 3, 2010 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.
Nacho_dj Posted October 3, 2010 Posted October 3, 2010 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now