Probably a newbie question but here it goes. I have a sub called search_app(tmp). When i pass a string constant everything is ok but if i pass a variable i get error CS1026 when compiling (optimized mode, version 6.8).
Code:
====================================
sub search_app(tmp)
found = false
I call the function inside an if statement like in the example code. What i try to do is iterate some dates and mark them with a dot if they exist in a list.
==== THIS WORKS==========================
If search_app("04/23/2010") Then
form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
===THIS FAILS=============================
X = "04/23/2010"
If search_app(X) Then
form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
X = "04/23/2010"
If search_app(X) Then
form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
Maybe there's a same function name or variable name used for an other thing...
Test just this:
B4X:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
X = "04/23/2010"
If search_app(X) Then
Msgbox("ok")
'form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
End Sub
Sub search_app(tmp)
found = True
'checking some stuff here....
Return found
End Sub
If it work check your code, maybe the problem is elsewhere...
Edit: It's weird but try this if really it doesn't work:
B4X:
Sub App_Start
X = "04/23/2010"
state=search_app(X)
If state Then
Msgbox("ok")
'form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
End Sub
Sub search_app(tmp)
found = True
'checking some stuff here....
Return found
End Sub
I call the function inside an if statement like in the example code. What i try to do is iterate some dates and mark them with a dot if they exist in a list.
==== THIS WORKS==========================
If search_app("04/23/2010") Then
form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
===THIS FAILS=============================
X = "04/23/2010"
If search_app(X) Then
form1.FCircle(x+32,y+50,7, 0,0,0,F)
End If
Sorry to have bothered you with this. Erel was right. My installation was faulty. He sorted me out and the weird error is gone. Thanks for your time anyway.