Page 1 of 1 1
Topic Options
#192330 - 2009-02-18 08:38 AM ascan() - support for multidimensional arrays
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
This has been discussed waaaayy back but never got implemented.

so, could you Ruud implement multidimensional array support for ascan?

when doing ascan against multidim array, one would give parameter saying which dimension to scan.

here's the working example code that demonstrates ascan for multidimensional arrays:
 Code:
Function mAscan($arr, $exp, $startAt, $dimensionToScan, optional $flags)
 dim $,$c,$cache[ubound($arr,$dimensionToScan)]
 $startAt=split($startAt)
 for $c=0 to ubound($arr,$dimensionToScan)
  $startAt[$dimensionToScan-1] = $c 
  $=execute("$$cache[$$c] = $$arr["+join($startAt,",")+"]")
 next
 $mAscan=ascan($cache,$exp,,,$flags)
Endfunction
_________________________
!

download KiXnet

Top
#192456 - 2009-02-23 10:30 PM Re: ascan() - support for multidimensional arrays [Re: Lonkero]
masken Offline
MM club member
*****

Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
Wouldn't it also be good to be able to do "wild" scans without specifying a dimension, and have the function return the "position" also?
_________________________
The tart is out there

Top
#192458 - 2009-02-23 11:47 PM Re: ascan() - support for multidimensional arrays [Re: masken]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that would be harder to implement and use.
and way slower.

in the old discussions we were chatting about the possibility but we never got to acreement.

and I would think the usability of such feature is limited, althought it might be nice at some times.
_________________________
!

download KiXnet

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 707 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.122 seconds in which 0.065 seconds were spent on a total of 13 queries. Zlib compression enabled.

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