brodmuehler Active Member Licensed User Longtime User Feb 20, 2019 #1 Dear All I have this function in my code ... which doesn't work. Could perhaps someone tell me why? It creates the following message .. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer Many thanks René Code: Copy Public Sub GesamtFlugzeit() As Long Return 2529360000 End Sub
Dear All I have this function in my code ... which doesn't work. Could perhaps someone tell me why? It creates the following message .. java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer Many thanks René Code: Copy Public Sub GesamtFlugzeit() As Long Return 2529360000 End Sub
S samikinikar Member Licensed User Longtime User Feb 21, 2019 #2 Its perfectly working here, kindly do check what are you doing after calling the function. Upvote 0
klaus Expert Licensed User Longtime User Feb 21, 2019 #3 You are probably doing something like this: Dim Zeit As Int Zeit = GesamtZeit Instead of: Dim Zeit As Long Zeit = GesamtZeit Upvote 0
You are probably doing something like this: Dim Zeit As Int Zeit = GesamtZeit Instead of: Dim Zeit As Long Zeit = GesamtZeit
brodmuehler Active Member Licensed User Longtime User Feb 21, 2019 #4 Thanks for your quick responses. I will check again. Did that yesterday almost whole day up to a point where I almost threw my computer out of the window (which was closed btw). Couldn't find anything. But you are right - there must be one. Thanks again. Rene Upvote 0
Thanks for your quick responses. I will check again. Did that yesterday almost whole day up to a point where I almost threw my computer out of the window (which was closed btw). Couldn't find anything. But you are right - there must be one. Thanks again. Rene
AnandGupta Expert Licensed User Longtime User Feb 21, 2019 #5 Hi Rene, brodmuehler said: Did that yesterday almost whole day up to a point where I almost threw my computer out of the window (which was closed btw) Click to expand... brodmuehler said: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer Click to expand... Before you turn to throw the poor computer next time and GOD forbid the window happen to be opened, try to read the error message closely. "ClassCastException" does signifies what masters already told you. Googling will also help, as B4A is Java based and errors are related to Java. I do the googling and many times found the hint to the problem, though I do not know Java, I can understand the explanations I find. Try it. It will save the poor computer which is trying to help you by showing the errors Regards, Anand Upvote 0
Hi Rene, brodmuehler said: Did that yesterday almost whole day up to a point where I almost threw my computer out of the window (which was closed btw) Click to expand... brodmuehler said: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer Click to expand... Before you turn to throw the poor computer next time and GOD forbid the window happen to be opened, try to read the error message closely. "ClassCastException" does signifies what masters already told you. Googling will also help, as B4A is Java based and errors are related to Java. I do the googling and many times found the hint to the problem, though I do not know Java, I can understand the explanations I find. Try it. It will save the poor computer which is trying to help you by showing the errors Regards, Anand
brodmuehler Active Member Licensed User Longtime User Feb 22, 2019 #6 Hi Everyone thanks for the nice words. Found the mistake and my computer (and windows) are still alive. This thread is closed. Thanks again. Best wishes René Upvote 0
Hi Everyone thanks for the nice words. Found the mistake and my computer (and windows) are still alive. This thread is closed. Thanks again. Best wishes René