View Full Version : Dynamic Arrays Revisited
Guest.Visitor
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
Bob, Using this method, what will happen as I shrink the array? Does the user space de-allocate memory as requirements are reduced? Thanks.
Guest.Visitor
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
As user space gets extended, is there a finite limit as to how far OS will auto-extend it?
Guest.Visitor
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
Bob, What happen with the "User space" when a program crash ? will the System automatically free the Storage or what? another Question, I would like to place more then one Array in the "User space" any Suggestion!!
t_sonny
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
Thanks for the tip I compiled & ran the program, element 1700 displayed "Hello World!" just as the article says. I used %elem and got 32766, I thought that it will extend the array one element at a time and not the defined "dim". Is my thought wrong?, thanks
R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
No, once a user space is extended is the permanantly resized. You can delete and recreate the user space each time you run your program, or simply reduce its size and call your program.
R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
The maximum size of the user space is 16 megabytes. This was an old (pre-64-bit OS/400) "feature". It did not change when they re-did much of OS/400 in 64-bit.
R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
%ELEM can only work with compiled data, hence the compiled number of array elements is 32766. :( You have to keep track of the number of element you insert into the array yourself. You can do this if the element are numeric by looking for one that contains zeroes (perhaps) or if theye are character by looking for a blank entry. Note that the user space will be created, by default with an initial value of X'00'. This means each new byte added to the user space is not a blank but a X'00'. This is the most efficient way to handle a user space.
R.Cozzi
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
If the user space is created in QTEMP, it is still in QTEMP. If you restart your program, the user space will still have the data stored in it. You can either take advantage of that or simply clear the user space (by "recreating" it).
MCWebsite.Staff
12-31-1969, 06:33 PM
** This thread discusses the article: Dynamic Arrays Revisited (http://www.mcpressonline.com/index.php?option=com_content&view=article&id=3529) **
This is a discussion about Dynamic Arrays Revisited.<p align='center'><a href=http://www.mcpressonline.com/mc?1@232.1KNKfHX1eQT.17@.6ae57f75>Click here for the article</a>.</p>
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.