mcorbeel Active Member Licensed User Longtime User Nov 10, 2020 #1 I use this in my B4i code: B4X: Copy If CheckBox_PrivateCar.Value Then f.Value = "1" Else .Value = "0" End If This gives error: Stack Trace: ( "0 Dylius SignalHandler + 112", "1 libsystem_platform.dylib 0x21df606f _sigtramp + 34", "2 Dylius -[b4i_class_edithours _readinput:] + 742", "3 Dylius -[b4i_page_edithours _page_edithours_resize::] + 830", "4 CoreFoundation <redacted> + 68", "5 CoreFoundation <redacted> + 292", "6 Dylius +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1790", "7 Dylius -[B4IShell runMethod:] + 588", "8 Dylius -[B4IShell raiseEventImpl:method:args::] + 1908", "9 Dylius -[B4IShellBI raiseEvent:eventarams:] + 1328" ) However, if I change B4X: Copy If CheckBox_PrivateCar.Value Then into B4X: Copy If CheckBox_PrivateCar.Value = True Then then the error is gone. Strange?
I use this in my B4i code: B4X: Copy If CheckBox_PrivateCar.Value Then f.Value = "1" Else .Value = "0" End If This gives error: Stack Trace: ( "0 Dylius SignalHandler + 112", "1 libsystem_platform.dylib 0x21df606f _sigtramp + 34", "2 Dylius -[b4i_class_edithours _readinput:] + 742", "3 Dylius -[b4i_page_edithours _page_edithours_resize::] + 830", "4 CoreFoundation <redacted> + 68", "5 CoreFoundation <redacted> + 292", "6 Dylius +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1790", "7 Dylius -[B4IShell runMethod:] + 588", "8 Dylius -[B4IShell raiseEventImpl:method:args::] + 1908", "9 Dylius -[B4IShellBI raiseEvent:eventarams:] + 1328" ) However, if I change B4X: Copy If CheckBox_PrivateCar.Value Then into B4X: Copy If CheckBox_PrivateCar.Value = True Then then the error is gone. Strange?
Sandman Expert Licensed User Longtime User Nov 10, 2020 #2 Yes, that seems strange, I don't have any real insights there, sorry. I have to ask, in line four you're missing an "f". That's not intentional, right? Also, I would guess that you could swap the whole code to: Code: Copy f.Value = CheckBox_PrivateCar.Value Upvote 0
Yes, that seems strange, I don't have any real insights there, sorry. I have to ask, in line four you're missing an "f". That's not intentional, right? Also, I would guess that you could swap the whole code to: Code: Copy f.Value = CheckBox_PrivateCar.Value
Erel B4X founder Staff member Licensed User Longtime User Nov 11, 2020 #3 Can you upload the project? Upvote 0
mcorbeel Active Member Licensed User Longtime User Nov 11, 2020 #4 I have seen it now in other places in my code and can confirm... Seems to be a difference between B4A en B4i. In B4A you can just write: Code: Copy if boolean_value then in B4i this sometimes gives error and you need to write: Code: Copy if boolean_value = True then Upvote 0
I have seen it now in other places in my code and can confirm... Seems to be a difference between B4A en B4i. In B4A you can just write: Code: Copy if boolean_value then in B4i this sometimes gives error and you need to write: Code: Copy if boolean_value = True then
mcorbeel Active Member Licensed User Longtime User Nov 11, 2020 #5 Sandman said: Yes, that seems strange, I don't have any real insights there, sorry. I have to ask, in line four you're missing an "f". That's not intentional, right? Also, I would guess that you could swap the whole code to: Code: Copy f.Value = CheckBox_PrivateCar.Value Click to expand... yes... the "f" got lost in the copy/past process ... Upvote 0
Sandman said: Yes, that seems strange, I don't have any real insights there, sorry. I have to ask, in line four you're missing an "f". That's not intentional, right? Also, I would guess that you could swap the whole code to: Code: Copy f.Value = CheckBox_PrivateCar.Value Click to expand... yes... the "f" got lost in the copy/past process ...
mcorbeel Active Member Licensed User Longtime User Nov 11, 2020 #6 I followed Sandman's suggestion and wrote B4X: Copy f.Value = CheckBox_PrivateCar.Value and the error was back... then I changed it to B4X: Copy if CheckBox_PrivateCar.Value = True then f.Value = "1" end if and the error is gone... Also tried to create a project that shows the issue, but it does not crash... Upvote 0
I followed Sandman's suggestion and wrote B4X: Copy f.Value = CheckBox_PrivateCar.Value and the error was back... then I changed it to B4X: Copy if CheckBox_PrivateCar.Value = True then f.Value = "1" end if and the error is gone... Also tried to create a project that shows the issue, but it does not crash...
Semen Matusovskiy Well-Known Member Licensed User Nov 11, 2020 #7 I am enough lazy to write If boolean_value = True Then . Never noticed any problem with If boolean_value Then. What is f in your sample ? f.Value is Boolean ? If so, why do you use f.Value = "1" ? (this gives an error Cannot parse: 1 as boolean) Upvote 0
I am enough lazy to write If boolean_value = True Then . Never noticed any problem with If boolean_value Then. What is f in your sample ? f.Value is Boolean ? If so, why do you use f.Value = "1" ? (this gives an error Cannot parse: 1 as boolean)
Erel B4X founder Staff member Licensed User Longtime User Nov 12, 2020 #8 iOS doesn't have a real boolean type. It is actually a number that is either 0 or 1. I'm not sure, but it might be related to the issue you encounter. Upvote 0
iOS doesn't have a real boolean type. It is actually a number that is either 0 or 1. I'm not sure, but it might be related to the issue you encounter.
mcorbeel Active Member Licensed User Longtime User Nov 12, 2020 #9 Erel said: iOS doesn't have a real boolean type. It is actually a number that is either 0 or 1. I'm not sure, but it might be related to the issue you encounter. Click to expand... Whatever I change... the error comes keeps coming back... starting to feel desparate. Are you willing to check my app in private? I don't like sharing it publicly because it contains too much info. Also you need special QR-code to use app... etc. Upvote 0
Erel said: iOS doesn't have a real boolean type. It is actually a number that is either 0 or 1. I'm not sure, but it might be related to the issue you encounter. Click to expand... Whatever I change... the error comes keeps coming back... starting to feel desparate. Are you willing to check my app in private? I don't like sharing it publicly because it contains too much info. Also you need special QR-code to use app... etc.
Sandman Expert Licensed User Longtime User Nov 12, 2020 #10 Is it possible to create a new skeleton project and reproduce this? Upvote 0
mcorbeel Active Member Licensed User Longtime User Nov 12, 2020 #11 Sandman said: Is it possible to create a new skeleton project and reproduce this? Click to expand... No... I tried creating an app that calls the issue but no succes... Upvote 0
Sandman said: Is it possible to create a new skeleton project and reproduce this? Click to expand... No... I tried creating an app that calls the issue but no succes...
mcorbeel Active Member Licensed User Longtime User Nov 12, 2020 #12 Semen Matusovskiy said: I am enough lazy to write If boolean_value = True Then . Never noticed any problem with If boolean_value Then. What is f in your sample ? f.Value is Boolean ? If so, why do you use f.Value = "1" ? (this gives an error Cannot parse: 1 as boolean) Click to expand... f.value is a string Upvote 0
Semen Matusovskiy said: I am enough lazy to write If boolean_value = True Then . Never noticed any problem with If boolean_value Then. What is f in your sample ? f.Value is Boolean ? If so, why do you use f.Value = "1" ? (this gives an error Cannot parse: 1 as boolean) Click to expand... f.value is a string
mcorbeel Active Member Licensed User Longtime User Nov 12, 2020 #13 I succeeded in creating a demo app that shows the issue, but I cannot upload it because I get " The uploaded file is too large for the server to process. " So I placed it on my server. URL in next post reply... The app start with a splash screen, then it downloads and shows a list of items (expense notes). When you tap the button "New expense note" the error is raised. As far as I can see the error comes from the "ReadInput" sub in "Class_ExpenseNote". Thanks all for trying... Last edited: Nov 12, 2020 Upvote 0
I succeeded in creating a demo app that shows the issue, but I cannot upload it because I get " The uploaded file is too large for the server to process. " So I placed it on my server. URL in next post reply... The app start with a splash screen, then it downloads and shows a list of items (expense notes). When you tap the button "New expense note" the error is raised. As far as I can see the error comes from the "ReadInput" sub in "Class_ExpenseNote". Thanks all for trying...
mcorbeel Active Member Licensed User Longtime User Nov 12, 2020 #14 https://dylius.com/downloads/ios_test.zip Upvote 0
Semen Matusovskiy Well-Known Member Licensed User Nov 12, 2020 #15 Looks as a bug. Replace Code: Copy If modCommon.Expensenote_Record.IsInitialized = True Then to Code: Copy Dim f As Boolean = modCommon.Expensenote_Record.IsInitialized If f Then If f = True also works. Guess, a problem is in a combination of factors. I used If x.IsInitialized then , don't remember troubles. Upvote 0
Looks as a bug. Replace Code: Copy If modCommon.Expensenote_Record.IsInitialized = True Then to Code: Copy Dim f As Boolean = modCommon.Expensenote_Record.IsInitialized If f Then If f = True also works. Guess, a problem is in a combination of factors. I used If x.IsInitialized then , don't remember troubles.
Sandman Expert Licensed User Longtime User Nov 12, 2020 #16 I think that your second example cast the value to a boolean, which then makes the if work. But that leaves the question why example 1 doesn't work. Because it seems reasonable that IsInitialized also is a boolean. Could it be something else, like 0 or 1? What happens if you change the first example so it compares to 1 instead of True? Upvote 0
I think that your second example cast the value to a boolean, which then makes the if work. But that leaves the question why example 1 doesn't work. Because it seems reasonable that IsInitialized also is a boolean. Could it be something else, like 0 or 1? What happens if you change the first example so it compares to 1 instead of True?
mcorbeel Active Member Licensed User Longtime User Nov 13, 2020 #17 I followed Semen's advise and changed my code in the sample app to: B4X: Copy Dim b As Boolean = modCommon.Expensenote_Record.IsInitialized if B then ... and the error was gone. So I did the same changes im my real app... and believe it or not, the error was back! Then I wrote: B4X: Copy Dim b As Boolean = modCommon.Expensenote_Record.IsInitialized = True if B then ... and now it stays okay... Upvote 0
I followed Semen's advise and changed my code in the sample app to: B4X: Copy Dim b As Boolean = modCommon.Expensenote_Record.IsInitialized if B then ... and the error was gone. So I did the same changes im my real app... and believe it or not, the error was back! Then I wrote: B4X: Copy Dim b As Boolean = modCommon.Expensenote_Record.IsInitialized = True if B then ... and now it stays okay...
mcorbeel Active Member Licensed User Longtime User Nov 13, 2020 #18 Sandman said: I think that your second example cast the value to a boolean, which then makes the if work. But that leaves the question why example 1 doesn't work. Because it seems reasonable that IsInitialized also is a boolean. Could it be something else, like 0 or 1? What happens if you change the first example so it compares to 1 instead of True? Click to expand... Comparing the value to 1 i cannot do because the class is shared with a B4A project... Upvote 0
Sandman said: I think that your second example cast the value to a boolean, which then makes the if work. But that leaves the question why example 1 doesn't work. Because it seems reasonable that IsInitialized also is a boolean. Could it be something else, like 0 or 1? What happens if you change the first example so it compares to 1 instead of True? Click to expand... Comparing the value to 1 i cannot do because the class is shared with a B4A project...
Semen Matusovskiy Well-Known Member Licensed User Nov 13, 2020 #19 As I understand, IsInitialized returns id (something similar to B4i objects). So I did the same changes im my real app... and believe it or not, the error was back! Click to expand... I believe And something talks to me that a problem, probably, is not relative to boolean values and not relative to IsInitialized as it is. I added Sleep into initial example and a program began to work also. So maybe there is a reason to look Sleep/Wait inside the program. Who knows, how B4i detects that an object is already initialized. For example, in Objective-C to allocate object and to initialize are different methods. Upvote 0
As I understand, IsInitialized returns id (something similar to B4i objects). So I did the same changes im my real app... and believe it or not, the error was back! Click to expand... I believe And something talks to me that a problem, probably, is not relative to boolean values and not relative to IsInitialized as it is. I added Sleep into initial example and a program began to work also. So maybe there is a reason to look Sleep/Wait inside the program. Who knows, how B4i detects that an object is already initialized. For example, in Objective-C to allocate object and to initialize are different methods.
mcorbeel Active Member Licensed User Longtime User Nov 13, 2020 #20 Welll, after working on other parts of my app, the error came back on the old place, without having changed it. So I also put in "Sleep(0)" en that solved the issue. The mystery keeps on growing... but at least I can continue now... Upvote 0
Welll, after working on other parts of my app, the error came back on the old place, without having changed it. So I also put in "Sleep(0)" en that solved the issue. The mystery keeps on growing... but at least I can continue now...