You have to have started and connected to the MIT Companion app.
Running it on your phone is the fastest and easiest.
You have to have started and connected to the MIT Companion app.
Running it on your phone is the fastest and easiest.
Hi
I am using the Companion App, but not the emulator.
Good.
Use the Connect->Companion option, and scan the code to complete the connection. Then you can set the phone down (I charge it) and apply Do Its in the Blocks Editor (after entering required inputs as needed)
Ok don't know what happened there, wasn't working before but is now. I'll have a go with it. Thanks again.
Hi again, I've got the following code and as you can see the Do It block on the a result of [9] which is correct, but when I try to display this using the volume text label i just get an empty string.
Any suggestions.
thanks
You executed the calculation of the Intersection using Do It, but you failed to apply Do It to the block that sets the value of that global variable?
Likewise for the next pair of blocks, that set the volume.Text value?
Is this what you mean? Or do you mean the currentOfferedToViewer and volumeText blocks need to have Do It done to them. If so I'm clicking on these 2 blocks getting the menu and clicking Do It but nothing happens. Is that because I already have Do It activated in a subsidiary block. If so how do I Undo Do It on those blocks?
thanks
Ok just tried hitting Do It for the volume text block and the correct result showed. will this happen automatically now each time it runs?
no
each time you have to click Do it again
Taifun
Do It is like a doctor hitting your knee with a rubber hammer to check your reflexes.
It's a one shot deal.
Hopefully, your knee works okay when you walk, without the doctor having to chase you down the street with his hammer.
OK, so thanks for your help with this, but this means that the Intersection block as above isn't working for me. It does produce the correct result if I do Do It to it but not otherwise, and obviously i can't keeping Do It -ing it in everyday use.
I'm going to try an approach of removing all the rows that don't meet the criteria for iscurrent (that is they are past a due date) - that is list 1 in the intersection block - from the spreadsheet then just searching the remainder - list 2 - for the relevant rows.
Any comment on how likely that is to work? Thanks!
I assume you will be working on an in-memory table copied from the spreadsheet, rather than trashing your data.
AI2 lists and tables are based on linked lists, so when you remove an item, every item past that index moves down to fill the empty index. This makes it necessary to loop from the end of the list down to 1 by -1 during a deletion pass.
Also, I missed something in your blocks:
You missed the point of the circled block.
It is explained here:
https://ai2.appinventor.mit.edu/reference/concepts/pholo.html
I left a tutorial copy of my intersection value procedure at
if you want to play with it or break it.
OK from the list block you noted 2 responses up I went to the associated link about functional blocks. From this it seemed the most useful approach for this situation would be the filter block. So I filtered the iscurrent block as below with the offerMadeToViewer block using blocks from the Intersection construct provided earlier.
Unfortunately as with previously using the Intersection block it's coming up just [] when I run or rerun the program.
Is this some sort of timing problem? If I used the clock to put in a delay before the calling the currentOfferedToViewer variable would that give the filter block above it time to run and come up with the [9] answer? Thanks again for your help.
Just to say, tried it with a clock delay, didn't work.
Any suggestions?
This thread is suffering from tunnel vision.
Each post explores a tiny bit of the problem, without access to the whole project and base database.
Could you post a link to the test data spreadsheet to allow exploration of all sheets?
An exported .aia file would also help.
If you need to guard your sheet access, then full block images of all events are needed, no code fragments, or remove your .json security file.
This does sound like a timing problem, or confusion between row ids and rows.
Which screen has the filtering for this thread?
(Nice documentation in the spreadsheet)
While I take the grand tour of your app, here are some bugs as I find them:
Also, that global row counter should be initialized at the top of the loop, for clean reusability.