AppLab output and dropdown list

Hello. I’m using AppLab with my 8th grade class. I’ve used AppInventor for several years with an AP CS Principles class. I’ve found that AppLab doesn’t always react the way I want it to. For example, in the code below, I get N for the output instead of the number 1. It’s very strange as the code is so basic. I’m declaring a variable and then just adding 1 to it in the checkbox event. But, instead of just adding 1, I’m getting the letter N for the output. Has anybody ever experienced anything like this with AppLab?

And while I’m here, can anybody share how to use a dropdown list to be able to choose from a variety of screens? I’ve found some tutorials on being able to have two items in a dropdown list and then move to the screen of the second option. But, I can’t seem to find anything that would allow me to put three or more options in a dropdown list and be able to go to the screen of whatever option I choose. The code at the bottom is from some feedback I got from the CS Discoveries forum about using a dropdown list to try to do what I discuss above in this paragraph. Thank you.

var Nike = 0;
onEvent(“button1”, “click”, function( ) {
setScreen(“screen2”);
});
onEvent(“checkbox1”, “click”, function( ) {
var Nike = Nike + 1;
setText(“label5”, Nike);
if (Nike >= 1) {
setText(“label7”, “Enjoy the Nikes”);
} else {
setText(“label7”, “No Nikes?”);
}
});
onEvent(“dropdown2”, “change”, function( ) {
var dropdown_Value = getProperty(“dropdown2”, “value”);
setScreen(dropdown_Value);
});

function( ) {
 var Nike = Nike + 1;

When you declare a variable it starts with the value undefined. When you use that in a mathematical expression the end value will be NaN. I am guessing that "label5" has just enough room to display the first character of NaN.

So don’t declare Nike a second time. Use the global variable Nike you set to 0 by removing var.

You can add as many options as you want to a drop down in the Design tab. Just add them to options.

You are correct. I should just have Nike = Nike + 1. Thanks.