I am somehow trapped...
everything worked fine until I added declaration and parsing of second list...
regardless what I do it will always end with null string error. If i switch order of the 2 lists it always crash on the last one....
First I thought its datetimeparse related. - so I separated it to the SUB. but it didnt help now the error seems that is on last line of the conversion function..but its not..
If i switch the order of the lists the error will be on line
so regardless what I do it always crash ...and the error is not helping in debuging the problem...
I tried to separate helpers but it didnt do the trick neither.
any ideas ?
everything worked fine until I added declaration and parsing of second list...
regardless what I do it will always end with null string error. If i switch order of the 2 lists it always crash on the last one....
First I thought its datetimeparse related. - so I separated it to the SUB. but it didnt help now the error seems that is on last line of the conversion function..but its not..
If i switch the order of the lists the error will be on line
B4X:
If mHelper2.Get("jazyk") == Jazyk Then
B4X:
Dim parser As JSONParser
parser.Initialize(j.GetString)
Dim m As Map = parser.NextObject
Dim mHelper As Map
Dim mHelper2 As Map
Dim error As String = m.Get("error") 'null = bez erroru
Dim hlaska As String = "error"
Dim Term1Od As Long
Dim Term1Do As Long
Dim Term2Od As Long
Dim Term2Do As Long
Dim Cas = DateTime.Now As Long
Dim CasOK As Boolean = False
If error <> Null Then
'parsovani hlasky a vyber spravneho jazyka
Dim hlasky As List
hlasky = m.Get("hlasky")
For i = 0 To hlasky.Size - 1
mHelper2 = hlasky.Get(i)
If mHelper2.Get("jazyk") == Jazyk Then
hlaska = mHelper2.Get("text")
End If
Next
'parsovani a naplneni rozvrhu
Dim casy As List
casy = m.Get("casy")
For i = 0 To casy.Size - 1
mHelper = casy.Get(i)
Log(mHelper.Get("od"))
Log(mHelper.Get("do"))
If i == 0 Then
Term1OdS = KonverzeCasu(mHelper.Get("od"))
Term1DoS = KonverzeCasu(mHelper.Get("do"))
else If i == 1 Then
Term2OdS = KonverzeCasu(mHelper.Get("od"))
Term2DoS = KonverzeCasu(mHelper.Get("do"))
End If
Next
End If
Sub KonverzeCasu (cas As String) As Long
Dim casTick As Long
Log ("konvert " & cas)
' cas = "23:59:00"
casTick = DateTime.TimeParse(cas)
Log ("konvert" & casTick)
Return casTick
End Sub
so regardless what I do it always crash ...and the error is not helping in debuging the problem...
I tried to separate helpers but it didnt do the trick neither.
any ideas ?