Page 1 of 1 1
Topic Options
#80794 - 2002-04-30 05:41 PM Allow embeded arrays...
Anonymous
Unregistered


Here's two examples... the first does not work, as I think it theoretically should, the second is my work around...

code:
Break ON

Global $Blah[2]
Global $Test[2]

$Blah[0] = 1

$Test[$Blah[0]] = "stuff"
;Basically saying: $Test[1] = "stuff"

? $Test[1]

The '$Test[$Blah[0]] = "stuff"' outputs a "0" and the print line does not output anything.

code:
Break ON

Global $Blah[2]
Global $Test[2]

$Blah[0] = 1

$workaround = $Blah[0]
$Test[$workaround] = "stuff"
;Basically saying: $Test[1] = "stuff"

? $Test[1]

This will only output "stuff".

Everytime I want to do this, I forget that kix does not support it. I know that the $Blah array in '$Test[$Blah[0]] = "stuff"' is being read, because if I do '$Test[$Blah[3]] = "stuff"', I get an "array reference out of bounds" error.

Could this be added to a future kix release? Thanks!

Top
#80795 - 2002-04-30 09:10 PM Re: Allow embeded arrays...
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I like the idea.. not sure I have a use for it (right now), but it certainly has potential to make code a bit simpler.

Brian

Top
#80796 - 2002-04-30 09:43 PM Re: Allow embeded arrays...
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I was surprised that this didn't work. Not a bug, but could it be an over-sight ?

-Shawn

Top
Page 1 of 1 1


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

Who's Online
0 registered and 640 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.081 seconds in which 0.052 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