I made a test about using Strings vs using Consts, and to my surprise, I didn't get any noticeable speed difference, I was expecting Const to being much faster actually.
Code: Select all
Const #TEST = 0
Const #NOT = 1
StartTimer(0)
a = #TEST
b = #NOT
c = 0
For n = 1 To 10000000
If a = #TEST Then c = c + 1
If b = #TEST Then c = c + 1
Next
DebugPrint(GetTimer(0))
ResetTimer(0)
a = "test"
b = "not"
c = 0
For n = 1 To 10000000
If a = "test" Then c = c + 1
If b = "test" Then c = c + 1
Next
DebugPrint(GetTimer(0))