Cannot figure out the Dictionary

Do you see the red X in the upper left corner of the init global examaps block?

Right click on that block and try to clear the error.

The error message is saying that the 'school' key is not found in the examaps dictionary.

Retype and reinsert the same school text block in the examaps and get value request, to make absolutely sure they match. Use the AI2 Copy Block to be sure. Make sure there are no leading or trailing blanks around the word school.

1 Like

I retyped school and name and copied them over but did not work could it be the device

What kind of device do you use for testing?

maybe the error is from here(that wasn't making any scene for me before but Nishyanth_Kumar told me it does make scene) :


or maybe the value does not have to be a integer
8ace682a403418277c4376a18f060bbaa

and because of these (or something else), global examples has an x and that means it will return nothing and nothing is not a dictionary

and your trying to get a value for key from nothing

now see the full image:

solution: maybe use text instead of math_number or maybe this is making the error or maybe you have to update your companion app

try to click on that X show us the message

This is a perfectly valid dictionary instantiation; it's a good example of nested dictionaries:

I hypothesize that OP's project and/or blocks are corrupt.


Even if examaps isn't recognized as a variable, it should result in a compilation error, not a runtime error.

Two other possibilities here are that the companion version is fairly old, or that this is the iOS companion where the publicly available version doesn't yet implement dictionaries. Both could result in the initialize block error.

1 Like

a school tablet

I have cleared the error and tried and did not work

looking in to it the oldest file is from Dec 7, 2018
At least in the app inventor file

would this fit those conditions?

and if so can it be fixed/updated?

android or apple ?

I have tried with both kinds of numbers and then letters and it failed

android

this is to fill minimum requirement

What happens if you try like this:

or this

I will try it


did not work

Try this aia project?
dicttry.aia (1.9 KB)

Does this also fail ?

Can you get someone to update the Companion on your school tablet?


still dose not work

not at the moment but maybe in a bit
and also update what app inventor/or the tablet its self

to version 2.62

This should resolve your issue. If not, ask for another tablet :wink:

@ABG on the money again :slight_smile:

1 Like