Hello,
I'm Andy, a farmer and RPG gamer living in the Mid-Atlantic area.
To date I have a number of programs that I use for work or gaming aids. One that keeps a data base of truck loads and harvest yields, and a number of RPG character generators.
I've been programming off and on since the days of Applesoft Basic and after some years discovered QBasic. I even once took a college course in Assembly for the 8088, but mainly it taught me that such things are beyond my pay grade.
I tend toward data manipulation programs and have little experience with graphics. My aps tend to use SCREEN 0 and have that clunky DOS look to them, but they tell me what I need to know.
My main reference in learning QB is....appropriately enough...QBasic for Dummies
[pause for laughter to fade...] ;)
I have recently dusted off my meager skills and am tackling yet another PC generator. This time for the new release of a game called Runequest. Only in this case the application is to handle multiple characters at once. Conceived to be a gamemaster aid to handle the tedium of CharGen, eliminating the page flipping, table referencing and tallying of skills, and keep track of the rather large amount of data associated with each PC.
and now for my question.
In the olden days redimensioning an array required iterating the original array into a temporary one, redimensioning the original to the larger size and then iterating the temporary array back into the original one, leaving space in the uppermost element for new entries. This is particularly tedious in this program since my approach is to use about 30 one dimensional arrays, and 3 two dimensional arrays, all of them shared globally with an original DIM SHARED in the main module.
I noticed QB64 includes the _PRESERVE command, if I'm reading it right, would this overcome the need for all the array swapping and iterating?
Is this as simple as:
REM $DYNAMIC 'metacommand in the main module then....
REDIM _PRESERVE array(increment element in question by 1) 'in a SUB dedicated to the redimensioning?
then going on business as usual adding the new PC in the uppermost elements?
I'd love to have it be so and dispense with all the FOR..NEXT iterations.
Thank you.