Page 1 of 2 12>
Topic Options
#66157 - 2002-06-05 09:19 PM Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
I'm not thinking very clearly today, can someone show me how to change the ubound of a multidimesional array after portions of the array have been populated?

-Jim

[ 05 June 2002, 21:20: Message edited by: jtokach ]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66158 - 2002-06-05 09:48 PM Re: Change the UBound of a Multidimensional Array
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Now, since KiXtart doesn't support multidimensional arrays, you will have to write your own function for a REDIM. I am assuning you are using the MArray() and MUbound() UDFs?
_________________________
There are two types of vessels, submarines and targets.

Top
#66159 - 2002-06-05 09:57 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Yeah, I am... I'll get busy [Smile]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66160 - 2002-06-06 07:05 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
For the love of pete, someone, please, can you run me through the logic of MUbound() and MArray()? Both are way over my head! I've been trying to sort them out for at least 4 hours now... Shawn's Array() seems pretty straight forward. I think this Andrew guy, is sure bet in KixGolf. [Smile]

-Jim
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66161 - 2002-06-06 07:35 PM Re: Change the UBound of a Multidimensional Array
Anonymous
Unregistered


Can you give a simple example of how the array is originally defined
and in what way you want the boundaries changed.

Top
#66162 - 2002-06-06 08:13 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Thanks for the quick turnaround. The problem is that I don't know the amount of data to be entered into the Marray ahead of time, therefore I need a dynamic Marray. If you have the time I'd still like to get a grasp on the logic as well as it seems like a great stepping stone towards scripting nirvana.

Thanks!

-Jim
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66163 - 2002-06-06 10:41 PM Re: Change the UBound of a Multidimensional Array
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Actually, the concept is easy. It's an array of arrays:
code:
DIM $a[10], $b[1]

$b[0]=$a
%b[1]=$a

Or am I wrong???
_________________________
There are two types of vessels, submarines and targets.

Top
#66164 - 2002-06-06 11:15 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Correct! However the means by which he executed that concept are... not so easy. Looks to be extremely efficient, but I have not even been able to step-by-step this and understand how it works... Very frustrating, yet intriguing. [Wink]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66165 - 2002-06-07 05:48 PM Re: Change the UBound of a Multidimensional Array
Anonymous
Unregistered


Sorry for delay, it takes me a while to knock up a new UDF, speaking of
which I hope this helps MRedim() - Resize multi dimensional arrays
I am in 2 minds about using it as trying to simulate MDA's with
high level languages is very resource hungry (especially with kixtart
passing parameters by value creating multiple copies in memory)
It is usually quicker to execute some kind of multiple looping than use
recursion, but I am still unsure about exactly what you are trying to do.
If your needs are not catered for by this please try and give some more
information about the array structure and how you wish to extend it.

Top
#66166 - 2002-06-07 05:56 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
[Big Grin] [Big Grin] [Big Grin] That's it! You rock! [Big Grin] [Big Grin] [Big Grin]

I still don't understand your code though... Can you PLEASE give me a blow-by-blow on the logic? It's a bit out of my league and will certainly help me and others move forward.

Thanks again!
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66167 - 2002-06-07 06:00 PM Re: Change the UBound of a Multidimensional Array
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I've always been afraid to look into the heart of MArray() and MUbound for fear that I might be blinded by its beauty, or worse, be turned into stone.

-Shawn

Top
#66168 - 2002-06-07 06:07 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
...the sort of general malaise that only the genius possess and the insane lament. [Big Grin]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66169 - 2002-06-07 06:12 PM Re: Change the UBound of a Multidimensional Array
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I just donned my meat hat. Minnie-Me ... you complete Me ! ... Those UDF's are groovy though, aren't they.
Top
#66170 - 2002-06-07 07:18 PM Re: Change the UBound of a Multidimensional Array
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
pinging AJH ... ease our torment !
Top
#66171 - 2002-06-07 08:50 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Please! I'm late for my flight to Rangoon where I will be taking Luge lessons! [Wink]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66172 - 2002-06-07 10:30 PM Re: Change the UBound of a Multidimensional Array
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO ROFLMAO !!!
Top
#66173 - 2002-06-11 04:46 AM Re: Change the UBound of a Multidimensional Array
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
These UDF's have, as the French say, that certain "I don't know what." - bump

[ 11 June 2002, 04:57: Message edited by: Shawn ]

Top
#66174 - 2002-06-11 03:54 PM Re: Change the UBound of a Multidimensional Array
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yeah, French always had a certain 'mystique' to it.
_________________________
There are two types of vessels, submarines and targets.

Top
#66175 - 2002-06-11 04:32 PM Re: Change the UBound of a Multidimensional Array
jtokach Offline
Seasoned Scripter
*****

Registered: 2001-11-15
Posts: 513
Loc: PA, USA
Throw us a fricken' bone here. [Smile]
_________________________
-Jim

...the sort of general malaise that only the genius possess and the insane lament.

Top
#66176 - 2002-06-12 02:10 PM Re: Change the UBound of a Multidimensional Array
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
completely insane method, but nice use of recursive calls. I especially love the use for $ptr to increase itself.
How long did you take to build a such thing ?
(anyway, you got my vote)
_________________________
? getobject(Kixtart.org.Signature)

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 675 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.144 seconds in which 0.064 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org