I’m a noob on Kodular so maybe I am posting something very simpleton, but here I am to ask some help.
I´ve just created a basic app to get familiar with Kodular and I am facing an weird non expected behavior: a time delay using an while loop is happening even before it should be performed, so if you run this app you’ll see that write commands located before this function call are only shown after this loop.
In the attached project you can find it in the “showBTState” function.
This an app only for learning purpose. The fact that while loop is executed before other commands catched my attention and, eventually, it may mess with another app. That why I need to understand what makes it happens so.
I think these days I had a similar problem, but I didn’t investigate deeply: I wanted to show a simple counter of how many records (from a table) had already been inserted in another table… only showed the end.… the label was blank and only at the end did it show the total of records…
I used to do this at the time of Clipper (there was no graphical environment , only MS-DOS) and it was necessary to show that there was a processing in progress…
So it was a message "Wait…Records : "+ varnumber
I’ve not commented before, but I notice something similar, besides the odd behavior related to the while loop: no label6 text was written during while execution. It’s only presented the content at its end (“count is finished”). Of course, write on label6.text before loop (“starting count”) cannot be seen, but probably there was no enough time to be visually noticeable, I presume.
Have you noticed your app only works at startup? When button3 is clicked, “showBTState” function is called at the end and, surprisingly, it doesn’t perform as expected: label3 and label4 are updated, but not label5. “starting count” appears, but never “count is finish”, as if that point was never reached.
It seems another mistery has been raised!
Anyway, the original mistery is still on: why that ‘while’ loop was being performed right at the beginning of the ‘showBTState’ function?
Also code was modified to run once. If you study the blocks you can create a procedure to run the same code many times by simply enabling and disabling clock. Also the problem with loops is that they run the code so fast that you can not see the changes and you get to see just the last one.
The only way to see the progress is by using a clock component that fires at specific time and each time the clock fires you call an item from the loop to show in a label
I still think it’s weird, but ok…but I’m in a paradox about the statement that the processing is very fast and the message “the app is taking too long to respond: close app or wait” I have 2 processes of 15.000 records in the database. 1 I have no control the other run inside a loop , item by item ( 15.000 records). I don’t understand if it’s fast so why the message.
I’m going to start testing ( after 13h ) with Asynchronous Extension.
Update
20:50
I haven’t used the extension mentioned above yet.
After researching I came to @Taifun taifun’s indications on this subject.