I need to do this comparison as fast as possible.
Since the elements in the list vary in quantity (even empty), i thought in NewList() and NewMap().
Code: Select all
NewList BRKPT.u()
AddElement(BRKPT())
BRKPT() = 100
AddElement(BRKPT())
BRKPT() = 200
AddElement(BRKPT())
BRKPT() = 300
AddElement(BRKPT())
BRKPT() = 400
AddElement(BRKPT())
BRKPT() = 500
AddElement(BRKPT())
BRKPT() = 600
AddElement(BRKPT())
BRKPT() = 700
AddElement(BRKPT())
BRKPT() = 800
time= ElapsedMilliseconds()
For cycle = 0 To 1000
For pc = 0 To 65535
ForEach BRKPT()
If BRKPT() = pc
;call procedure
EndIf
Next
Next pc
Next cycle
MessageRequester("Time total",Str(ElapsedMilliseconds() - time))
Code: Select all
NewMap BRKPT.u()
BRKPT("100") = 100
BRKPT("200") = 200
BRKPT("300") = 300
BRKPT("400") = 400
BRKPT("500") = 500
BRKPT("600") = 600
BRKPT("700") = 700
BRKPT("800") = 800
time= ElapsedMilliseconds()
For cycle = 0 To 1000
For pc = 0 To 65535
If FindMapElement(BRKPT(), Str(pc))
;call procedure
EndIf
Next pc
Next cycle
MessageRequester("Time total",Str(ElapsedMilliseconds() - time))
Is there any other way more fast?
thanks