[bb] Delete similar types by Shambler [ 1+ years ago ]

Started by BlitzBot, June 29, 2017, 00:28:41

Previous topic - Next topic

BlitzBot

Title : Delete similar types
Author : Shambler
Posted : 1+ years ago

Description : Deletes type 'copies' leaving a unique set of types that all have different values.

Code :
Code (blitzbasic) Select
Type mytype
  Field xfactor
End Type

somany=1000

For some=1 To somany
  m.mytype=New mytype
  mxfactor=Rnd(100)
Next

For m.mytype=Each mytype
  Print mxfactor
Next

start=MilliSecs()

For a.mytype=Each mytype

  For b.mytype=Each mytype

  If Handle(a)<>Handle(b)

    If axfactor=bxfactor

    Delete b

    EndIf

  EndIf


  Next

Next

time=MilliSecs()-start

For m.mytype=Each mytype
  Print mxfactor
Next

Print "Search took "+time+" millisecs for "+somany+" types"


While Not KeyHit(1)
Wend


Comments : none...