Opening last page crashes my app

Hi, I’m currently creating an app for a school project. I have several pages with questions about the user’s shopping habits, and the final page theoretically shows the user what their environmental impact (how much carbon they produced, how much water they used, how many bags in the landfill, and how many bags are littered) for each time they shop. However, when I click the button to open my last page, my app crashes and goes back to the login screen (which is set to automatically log me in and goes to the first page of my app. Any particular reason why, and/or suggestions on how to fix this? Thank you

Nobody has a crystal ball. You’re going to have to show your blocks otherwise people are just going to have to guess.

Sorry, you will have to show more that this.
You state that when you “click the button to open the last page” is when the app crashes.
Where is the logic that is started by the clicking of this button?

Screen Shot 2019-12-11 at 4.51.25 PM

Screen Shot 2019-12-11 at 4.52.02 PM

It also happens when I press skip
Screen Shot 2019-12-11 at 4.54.40 PM

A lot of things can be wrong.
In your calling screen, what happens if “Text_Input1” is “13” (given that you handle when it is 12 and when it is 14, but not when it is 1, 3, 5, etc.).
Also, what happens if “Text_Input1” was left completely blank?

In the case you press “Skip6”, then you may have an issue with the values of “app travelled”, “app carbonBag” etc. not being defined or not being defined as numbers.
But there is a definite issue is “app litter” is less than 1, since you replace its value with the text string “Less than 1”. At the end of your Final.Starts block, you set up weekLitter to a computation that uses the value of “app litter”, which you may think is 0, but is NOT A NUMBER, since you just set it to “Less than 1”. That would raise an exception that should normally be indicated as a pop up, but depending on your platform, perhaps your OS implementation is not so kind as to share that information, and simply decide to crash.

You are doing the same kind of alteration to “app inLandfill”, also set to a text if less than 1 and later used in a mathematical operation (the setting of decimal places).


I did have a thing where I had something happen if the variable wasn’t covered, but I missed it in my screenshot. But, I got rid of my if statements and it worked! Thank you so much!

1 Like