The first is in line 19. Breed is a full array. Think about what your conditional is trying to compare.
The 2nd error is in line 25. When you run it, you will see that you have a uistring error. In this case, you are trying to set the “text” to be an array when “text” should be a string. (btw, you can’t use [i] here as you aren’t in the middle of an [i] loop).
Can you find a way to convert the contents of the entire array to be a string?
There are several things missing in the updateScreenWorker() and updateScreen() functions. In the updateScreenWorker, we need a string where all the dog names must be concatenated to add to the text area. We also need a separate index variable for the WorkerNames list. See the code below.
function UpdateScreenWorker() {
var s = ""; //String to save all the Worker Dog names
var j = 0; //index for the WorkingNames list
for (var i = 0; i < DogNames.length; i++) {
if (Breed[i] == "Working") {
appendItem(WorkerNames, DogNames[i]);
s += WorkerNames[j] + "\n"; //Add the dog name to the list
j++; //increment the index
}
}
console.log(WorkerNames);
setScreen("LLworkers");
setProperty("LLWorkers", "text", s); //set the text to the string that contains all the dog names
}
Similar changes need to made to the UpdateScreen function.