Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,32 +0,0 @@
|
|||
class flattener
|
||||
dim separator
|
||||
|
||||
sub class_initialize
|
||||
separator = ","
|
||||
end sub
|
||||
|
||||
private function makeflat( a )
|
||||
dim i
|
||||
dim res
|
||||
for i = lbound( a ) to ubound( a )
|
||||
if isarray( a( i ) ) then
|
||||
res = res & makeflat( a( i ) )
|
||||
else
|
||||
res = res & a( i ) & separator
|
||||
end if
|
||||
next
|
||||
makeflat = res
|
||||
end function
|
||||
|
||||
public function flatten( a )
|
||||
dim res
|
||||
res = makeflat( a )
|
||||
res = left( res, len( res ) - len(separator))
|
||||
res = split( res, separator )
|
||||
flatten = res
|
||||
end function
|
||||
|
||||
public property let itemSeparator( c )
|
||||
separator = c
|
||||
end property
|
||||
end class
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
dim flat
|
||||
set flat = new flattener
|
||||
flat.itemSeparator = "~"
|
||||
wscript.echo join( flat.flatten( array( array( 1 ),2,array(array(3,4),5),array(array(array())),array(array(array(6))),7,8,array())), "!")
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
' Flatten the example array...
|
||||
a = FlattenArray(Array(Array(1), 2, Array(Array(3,4), 5), Array(Array(Array())), Array(Array(Array(6))), 7, 8, Array()))
|
||||
|
||||
' Print the list, comma-separated...
|
||||
WScript.Echo Join(a, ",")
|
||||
|
||||
Function FlattenArray(a)
|
||||
If IsArray(a) Then DoFlatten a, FlattenArray: FlattenArray = Split(Trim(FlattenArray))
|
||||
End Function
|
||||
|
||||
Sub DoFlatten(a, s)
|
||||
For i = 0 To UBound(a)
|
||||
If IsArray(a(i)) Then DoFlatten a(i), s Else s = s & a(i) & " "
|
||||
Next
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue