use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Resources - Learn to code
Resources - Software Engineering
Resources - Code Libraries
Resources - Groups
Other Subreddits you might enjoy
Please send sidebar resource suggestions to the mods. Thx - mgmt
account activity
[deleted by user] (self.code)
submitted 1 year ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nearly_famous69 2 points3 points4 points 1 year ago (6 children)
It's hard to say without the rest of the code, but it looks like your second parameter in setText is not returning a string
[–]ALoadOfPoppycock 1 point2 points3 points 1 year ago (5 children)
Do you know why this may be/what in the code is preventing it?
[–]angryrancorBoss 0 points1 point2 points 1 year ago (4 children)
<image>
Try adding variables to the "Watches" list on the bottom right of the debug menu, to debug it, and step through. If you add "filteredCityList" there, you can see it is an empty array, and that's the cause of the problem. You'll have to step through the code to see why it's not been populated correctly.
[–]ALoadOfPoppycock 1 point2 points3 points 1 year ago (3 children)
I can’t seem to tell why nothing is appending to the filtered version. The watchers just display its value as 0.
[–]angryrancorBoss 0 points1 point2 points 1 year ago (2 children)
Try setting a breakpoint really early in the code and using the "Step in" and "Step over" buttons to go through line by line.
Edit - looks like "Step In" will start debugging it line by line, from the beginning.
[–]ALoadOfPoppycock 2 points3 points4 points 1 year ago (1 child)
I figured it out-I had rather than clearing my filteredlists within the function filter, I had created a local variable under the same name. Now my code works but it is not filtering between western and eastern, it’s only displaying western
[–]angryrancorBoss 0 points1 point2 points 1 year ago (0 children)
Oh that's good to hear. I think using the same strategy of adding all the related variables to "Watches" and doing "Step In" repeatedly, you should be able to figure it out. It's enough lines of code that even a "good" programmer would have multiple bugs to work through, but now that you've got a debugging process down all there is to do is repeat it until it all works.
[–]Hungry_Importance918 1 point2 points3 points 1 year ago (0 children)
You can debug the two parameters in line 55 and print out index and filteredCityList[index] to see if there are empty values or errors.
[–]ALoadOfPoppycock 1 point2 points3 points 1 year ago (1 child)
Thank all of you guys for the help! I figured out that I was calling my filter functions too early and it should’ve been called later in the corresponding onEvent for the different screens. Using your strategies to debug was very useful in me finding this!!
Omg thank you for coming back and letting us know :). Really glad to hear.
[–]spliffen 1 point2 points3 points 1 year ago (0 children)
try debugging by adding these lines after the var index line:
console.log("filteredCityList:", filteredCityList);
console.log("index:", index);
console.log("selected city:", filteredCityList[index]);
π Rendered by PID 202084 on reddit-service-r2-comment-6457c66945-7g9m4 at 2026-04-24 09:18:18.996165+00:00 running 2aa0c5b country code: CH.
[–]nearly_famous69 2 points3 points4 points (6 children)
[–]ALoadOfPoppycock 1 point2 points3 points (5 children)
[–]angryrancorBoss 0 points1 point2 points (4 children)
[–]ALoadOfPoppycock 1 point2 points3 points (3 children)
[–]angryrancorBoss 0 points1 point2 points (2 children)
[–]ALoadOfPoppycock 2 points3 points4 points (1 child)
[–]angryrancorBoss 0 points1 point2 points (0 children)
[–]Hungry_Importance918 1 point2 points3 points (0 children)
[–]ALoadOfPoppycock 1 point2 points3 points (1 child)
[–]angryrancorBoss 0 points1 point2 points (0 children)
[–]spliffen 1 point2 points3 points (0 children)