http://gambaswiki.org/bugtracker/edit?object=BUG.1102=L21haW4-
Comment #1 by PICCORO LENZ MCKAY:
hi, this query make me impossible document and find a solution to how populate
a grid not using the Data event...
i send a issue to freetds project, due this error today does not permit to me
got
Jussi said:
> As Fernando stated your code is good only for small arrays. But if someone
>is going to use it, here is correct implementation:
No, Jussi, I didn't say it is good only for small arrays. I said some
suggestions apply only
to small arrays because if I have to traverse the array again
As Fernando stated your code is good only for small arrays. But if someone
is going to use it, here is correct implementation:
For x = 0 to a.Max
if z.Find(a[x]) = -1 Then z.Add(a[x])
Next
z.Exist() might be faster... I don't know.
Jussi
On Tue, Jun 27, 2017 at 6:59 PM,
Nando
The problem with this search and destroy method without pre-sorting is the
exponentional
growth in time needed to do the job. If my math is not wrong, this is how
quickly it gets unmanageable:
Items / Comparisons needed (worst case scenario)
10 = 45
100 = 4,950
1000 = 499,500
1000 =
On Tue, 27 Jun 2017, Fernando Cabral wrote:
> So, my question is basically if Gambas has some built in method do
> eliminate duplicates.
> The reason I am asking this is because I am new to Gambas, so I have found
> myself coding
> things that were not needed. For instance, I coded some functions
2017-06-27 11:29 GMT-03:00 Tobias Boege :
>
> Your first sentence is a bit confusing. First you say that your array is
> sorted but then you say that duplicates may be scattered across the array.
>
You are right. My fault. The array is sorted. What I meant by scattered was
that
Well, there is complicated, then there is simplicity:
I tested this. Works for sorted, unsorted.
Can't be any simpler.
Public Function RemoveMultiple(a As String[]) As String[]
Dim x as Integer
Dim z as NEW STRING[]
For x = 1 to a.count()
if z.Find(a) = 0 Then z.Add(a[x])
Next
'if you want
My two cents.
Public Sub Main()
Dim sSort As String[] = ["A", "B", "B", "B", "C", "D", "D", "E", "E",
"E", "E", "F"]
Dim sSame As String[] = sSort
Dim bb As New Byte[]
Dim sSingle As New String[]
Dim i, n As Integer
For i = 0 To sSort.Max
If i < sSort.Max Then
If sSort[i]
Another very effective and simple would be:
You have your array with data
You create a new empty array.
Loop through each item in your array with data
If it's not in the new array, then add it.
Destroy the original array.
Keep the new one.
...something like (syntax may not be correct)
Public
On Tue, 27 Jun 2017, Fernando Cabral wrote:
> Hi
>
> I have a sorted array that may contain several repeated items scattered all
> over.
>
> I have to do two different things at different times:
> a) Eliminate the duplicates leaving a single specimen from each repeated
> item;
> b) Eliminate the
Hello,
look here:
8<-
Public Function RemoveMultiple(aStringListe As String[]) As String[]
Dim iCount As Integer
Dim iIndex As Integer
Dim sElement As String
iIndex = 0 ' Initialisierung NICHT
Hi
I have a sorted array that may contain several repeated items scattered all
over.
I have to do two different things at different times:
a) Eliminate the duplicates leaving a single specimen from each repeated
item;
b) Eliminate the duplicates but having a count of the original number.
So, if
Hi Piccoro,
Many thanks for the speedy reply.
The project currently uses the following components:
gb
gb.form
gb.image
gb.net
gb.qt4
gb.qt4.ext
gb.qt4.ext
gb.qt4.webkit
gb.vb
Regards,
Phil
From: PICCORO McKAY Lenz
Sent: 26
13 matches
Mail list logo