Read with exact filter - works on columns, can it also work on rows?

Ok to clarify by 'Do It' you mean the purple procedure block - to procedure do ?

If so I'll work on this with the 'iscurrent' and 'offerMadeToViewer' variables.

Also could you clarify 'feeding output back into an input fouls up debugging'?

thanks

Extra global variables can be used to hold intermediate calculation results unsullied for later examination.

Did you notice the bubble on the screen shot of my sample call?
That's an MIT AI2 debug facility, in the introductory section off the debugging FAQ.

Make your blocks look like a pincushion with Do It bubbles.

OK, I'll read up on Do it bubbles and get back to you, might be a couple of days.

Again thanks for your help :slightly_smiling_face:

Hi again, sorry when I right click on the various blocks 'Do It' is either not there, or greyed out.

Any suggestions?

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
image

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
image

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.


Though it leaves no comment bubble behind, this is a shot of me applying a Do It to the set Label1.Text block in this code sequence. The running app reflects the effect of that in the Label.

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:
ebdb1026273f27339efdbe48bb6574aa2a77cd82

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.


This gives me a correct [9] response when I Do It to the subsequent currentOfferedToViewer variable.

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.