Table: Resize all variables such as ReDim (New, New, New) and not only ReDim (10, New) the last ...
Like, in Old QB, and PowerBasic, and many other languages.
Its necessary when you work and use with various file open simultaneously in conjunction with the tables... And you work with 3, 4 or 5 dimension...
I have many SGBD created from me, with possibility to work with ISAM file but its necessary have, a possibility ReDim with various parametter...
Tanks for attention ! (Sorry for the English, I am French Belgian).
Table: Resize all variables in ReDim (New, New,10,New) like.
Wy Using ReDim with all Items... ? Exemple :
If i have one or more table like : TableFile$(NumberLine, NumberCol)
Table where the columns would be = (Idend., Name, adress, zipcode, city,..., etc...)
In such a table, If I do not know in advance the number of lines, I need return the table Like this : TableFile$ (NumberCol, NumberLine).
1- It is not very compatible with the presentation of conventional tables.
2- Now If in addition I should manage these tables with Files
3- But I would also like more FILES in connection with these tables....
My Table will be see like this : TableFile$(NumberOfFile, NumberLine_Of_EatchFile, NumberCol_Of_EatchFile)
But if you do not know in advance the number of file to open, the number of articles that contain all the files, then it must be possible to dynamically resize the tables ...
This demonstrates the usefulness of power resize any table parameter
If i have one or more table like : TableFile$(NumberLine, NumberCol)
Table where the columns would be = (Idend., Name, adress, zipcode, city,..., etc...)
In such a table, If I do not know in advance the number of lines, I need return the table Like this : TableFile$ (NumberCol, NumberLine).
1- It is not very compatible with the presentation of conventional tables.
2- Now If in addition I should manage these tables with Files
3- But I would also like more FILES in connection with these tables....
My Table will be see like this : TableFile$(NumberOfFile, NumberLine_Of_EatchFile, NumberCol_Of_EatchFile)
But if you do not know in advance the number of file to open, the number of articles that contain all the files, then it must be possible to dynamically resize the tables ...
This demonstrates the usefulness of power resize any table parameter
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
you can use Dim on an existing array with arbitrary size in all dimensions,
even with other dimensions, but the content will be erased.
ReDim is for keeping existing content, and so only the outermost Dimension can be changed because there is no complicated element copying involved.
implementing a ReDim with arbitrary dimension change would mean to implement most complicated moving of single elements.
about your example: TableFile$(NumberOfFile, NumberLine_Of_EatchFile, NumberCol_Of_EatchFile)
imho it is just the way how-not-to-be-done.
putting several files into one single array of strings, sounds like an idea of Edgar Allen Poe... most creepy.
even with other dimensions, but the content will be erased.
ReDim is for keeping existing content, and so only the outermost Dimension can be changed because there is no complicated element copying involved.
implementing a ReDim with arbitrary dimension change would mean to implement most complicated moving of single elements.
about your example: TableFile$(NumberOfFile, NumberLine_Of_EatchFile, NumberCol_Of_EatchFile)
imho it is just the way how-not-to-be-done.
putting several files into one single array of strings, sounds like an idea of Edgar Allen Poe... most creepy.
oh... and have a nice day.
Thank you very much,
I know the ReDim function for a very long time ...
And that is precisely what I would do it but in other dimensions, and not just the latest ...
And this is an example of Table I shows as it should be resized ...
Thing, which was easily in the versions of Qb to QBX ... But long ago and in other languages ...
They served me a gerer tables dynamically configurable multiple dimensions.
Thank you anyway!

I know the ReDim function for a very long time ...
And that is precisely what I would do it but in other dimensions, and not just the latest ...
And this is an example of Table I shows as it should be resized ...
Thing, which was easily in the versions of Qb to QBX ... But long ago and in other languages ...
They served me a gerer tables dynamically configurable multiple dimensions.
Thank you anyway!


Would something like this work for you?GeBonet wrote:Wy Using ReDim with all Items... ? Exemple :
If i have one or more table like : TableFile$(NumberLine, NumberCol)
Table where the columns would be = (Idend., Name, adress, zipcode, city,..., etc...)
In such a table, If I do not know in advance the number of lines, I need return the table Like this : TableFile$ (NumberCol, NumberLine).
1- It is not very compatible with the presentation of conventional tables.
2- Now If in addition I should manage these tables with Files
3- But I would also like more FILES in connection with these tables....
My Table will be see like this : TableFile$(NumberOfFile, NumberLine_Of_EatchFile, NumberCol_Of_EatchFile)
But if you do not know in advance the number of file to open, the number of articles that contain all the files, then it must be possible to dynamically resize the tables ...
This demonstrates the usefulness of power resize any table parameter
Code: Select all
Structure element
Idend.s
name.s
Address.s
zipcode.s
city.s
EndStructure
NumberLine = 300
Dim TableFile.element(NumberLine)
;change size
NumberLine = 500
Redim TableFile(NumberLine)
I second Kaeru's comment that you may be trying to force something into a multi-dimensional array that shouldn't be there in the first place.
If all the elements of your table are the same (i.e. strings) then you can copy them all to a single dimension array, recreate the multi-dimensional array with the new dimensions, then copy the elements back in. That is what the suggested feature request would be doing anyway.
I'll post an example if this would be useful.
Last edited by Demivec on Sun Apr 19, 2009 11:55 pm, edited 1 time in total.
Kaeru Gaman wrote:you can use Dim on an existing array with arbitrary size in all dimensions,
even with other dimensions, but the content will be erased.

Infact I was looking for a workaround to this just last night and thinking of changing data structure so that I didn't have a 2d array in there.
Cheers

Paul Dwyer
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein