For some reason I can't store a variable in a dictionary value

It's good that you are learning to read code critically.

Every piece of code has behind it a set of unstated assumptions and promises made, which much be verified by the code reader.


found this, match the reds and blues and it is trying to set progress to count and count to progress. but i still would think that i would get some kind of value form it. im still looking for things

nothing so far. this is strange for it to just happen this way. there are no error messages at all, and it just starts with the labels as zero.
image
here though, i think I'm on to something. it clearly isn't finding the tag. it has to be getting deleted somewhere, so I'm going to check on screen four to see if the name gets altered, or the progress gets deleted there. here is the screen four code.

You initialize global variable list to a blank text.

Then in the code you try to treat it like a list, using list blocks.

If you want an empty list, use the create empty list block.

I can't comment on blocks hidden behind other blocks.

switch screens correctly

Taifun

image

You are using global new as an index for a remove list item block, yet earlier you had been setting it either to a list or a project name or a blank.

List indexes are numbers 1,2,3,... up to the length of the list.

It's time you rename the variable 'list' to say what it is a list of.

Also, your block images are too fuzzy.
(Canned Reply: ABG - Download those blocks and post them here)

Please download and post each of those event block(s)/procedures here ...

sample run downloading blocks

sample run uploading blocks

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See Download Block Images for a demo.

Study the introductory articles at

image

You know that global variables are not shared across screens, right?

yes, i did set the variable to a blank text, i just didn't think when i switched to when screen initailize set global variables instead of initializing directly.

this is the opening screen, but to avoid further confusion i will rename the screens.
also,the link you gave me was super helpful. thanks. i'll switch to that method.

i made adjustments up in the top.I also decided that the name variable is just a copy of new_project and its useless. Also, sorry for the fuzzy images.

and yes, i do know that variables do not travel across screens.

I'm lost.

What's the problem?

the problem is that the app wont save any of your progress. I brought up the screen four stuff because i think the name might be getting changed and that is part of the tag, so it has to be the exact same thing every time. i would expect an error message or something though. also what do you use for video clips?

There is a TinyDB block that returns the entire content of TinyDB as a dictionary. It makes for good debugging visibility. Add a DebugTinyDBLPK List Picker to your screens, and set its BeforePicking event to load Elements from the output of that block.

image

where do you find the DebugTinyDBLPK List Picker at? i'll try the recording software too.

Drag a listpicker into the working area and rename it to DebugTinyDBLPK

Taifun



Sample run
TinyDB_ListPicker.aia (1.6 KB)

By the way, if you have multiple instances of TinyDB under different names in different screens, check their NameSpaces (TinyDB1 by default).

Two TinyDb instances with the same NameSpace end up sharing the same XML file on the phone, and can wipe each other out.


like this?also, i only have a single tiny db. i just found something! i created a new project set the rows in project and stitches in row, and it set rows to rows in project and stitch to stitches in row. the listpicker doesn't show anything useful, though. something is switched. this is great! all we need to do is look out for anything that is switched around. but something on screen four made the progress work! it just shows it as completed.

I found it! the app doesn't set the dictionary to the progress. the save button only saves the stitches in row and rows in project, it doesn't override the original progress dictionary with the new progress


IT WORKS!!!! yes! finally it works. thank you everyone who helped me, this is great. thank you so much. the blocks at the top are the changes that i made.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.