How Do I Resolve The Error?

How to resolve the below error:

Look in your blocks for the Canvas block that draws points.

Look at its sockets.

Trace back how you fill those variables with values, and when you do that.

Or post your blocks and let us help you do it.

Images Of Blocks:
blocks (4) 3

You are using "" as the default value returned if nothing is found under tags 'X' or 'Y' in TinyDB.

A blank is not a valid x or y value for drawing points.

I have to ask:

  • Why use TinyDB to store X and Y values, when you could have done an init global X = 1 , likewise for Y ?

  • Why use two TinyDbs ?

1 Like

Seriously telling, I can't remember that why I used TinyDB to store X and Y values, because I was working on this project around 6 months ago. And now I am also confused. But I remember that I asked a question some time ago "Make Shapes On Canvas". I created this code by using the solutions of that question.
So please help me in it.

And there is one more error:

This error came when I choose "Square" from "Shapes".

These errors come only when I choose any option from Shapes without touching the canvas.
So @ABG please help me in it also.

If in doubt,
Rip It Out.


Regarding the error message
"Bad Arguments to + ..."

Locate the places where you use the math block '+', and trace back where they get their inputs. Since one of the inputs is a blank, according to the message, that also points to your TinyDB blank default.

So rip out all the TinyDb blocks before anything else.

I know why you would store the coordinates in TinyDb - it would enable a re-draw of the shapes stored. So you could close the App, return another day, redraw what you had drawn so far. Or 'erase' a specific shape by redrawing all of them except the one to be erased.

Concerning 'null' values, don't let the User input them. When the User submits coordinates, verify them - if not as required, reject them and pop-up a Notifier to tell the User what is wrong.

1 Like

Can I give a global value to X and Y or set a value of X and Y in the block When Screen Initializes?