Hey guys,

I was wondering if there's a way to filter an array without having to go
through the whole thing

I've been experimenting with the Find method of the String[] but it only
looks for specific values

ie:
------------------------------------------------------------------------------------------
PUBLIC e AS NEW String[]

PUBLIC SUB Form_Open()
e.Add("D1", 0)
e.Add("D9 D7", 1)
e.Add("D3", 2)
e.Add("D2", 3)
e.Add("D4 D2", 4)
END

PUBLIC SUB Button3_Click()

Dim d AS Integer

d = e.Find("D2")
PRINT d

END
------------------------------------------------------------------------------------------
d will get the value 3. However the next value e.Find("D2) will result
to is a -1 (means the item's not found)

my questions are these

1) is it possible to put wildcards in the string Find is looking for?
so for example as to also catch "D4 D2"?

2) is there a workaround so I can only keep the values Find gives
out a result and discard the rest of the array so essentially I get
only those items I want and nothing else?

I use Gambas 2.12 in Debian Lenny (Stable)

Thanks in Advance
Regards
Dimitris
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to