Sub main1
Dim k11,k12,k13,k14,k15,k16,k17,k18,k19,k20 As Int '<== problem
'Dim k11,k12,k13,k14,k15,k16,k17,k18,k19,k20 As String '<== stable
Dim g As String
g = "01000003010010110001" 'fixed string value always stable.
'local declaration of k variables converted to int from num. parts of the string
k11 = g.SubString2(2,4)'
k12 = g.SubString2(4,5)
k13 = g.SubString2(5,6)'
k14 = g.SubString2(6,7)'
k15 = g.SubString2(7,8)'
k16 = g.SubString2(10,11)'
k17 = g.SubString2(9,10)'
k18 = g.SubString2(14,15)'
k19 = g.SubString2(14,16) '
k20 = g.SubString2(13,14) '
Log(k12) ' result always 0'
Anothersub(k12)
Log(k12) ' not always 0 value changes in release mode to high random value when i use integers.
End Sub