Issue adding a new function
in
Programming Questions
•
1 year ago
I'm having a pretty strange problem, hoping someone can see whatever it is I'm missing.
I created a new function, and I keep getting the "the function after() does not exist" I tried a lot of usual stuff like changing the name, return type, etc. None of that worked. Then I started messing with other functions and found that for some reason in this particular block, if I add a function it throws things off, even when I'm just copying and pasting an existing function. The issue is in the after() function in the dayOfData class. I've been focusing on that, and messing with date() which is right there, to try to debug. The strangest part is that if I copy date and make it date2() it works when I call it in setup but can't find it when I call it in this other spot. I'm beginning to think I'm going crazy, wonder if you can see something I'm missing?
(It's too long to include everything, so I included the parts that seem relevant, problem code is in red)
-
Slider dial;CalendarButtons[] day;CompareButtons[] compare;ZoomButton[] zoomButton;DayOfData[] dataDay;SideButtons leftButton;SideButtons rightButton;
//parse files for each day and assign date and day of the weekdataDay = new DayOfData[totalDays];//sampleDay = new DayOfData("2011-07-09", "Saturday");for (int i = 0; i < totalDays; i++) {dataDay[i] = new DayOfData(day[i].date(), weekdayName[i]);}
//find out what date is selectedfor (int i = 0; i < totalDays; i ++) {if (day[i].daySelected()) {selectedDate = day[i].date();bedAfterMidnight = day[i].after();println(bedAfterMidnight);}}
class DayOfData {//global variablsString date, weekday;int sample = 1;
String date() {return date;}
boolean after() {return bedAfterMidnight;}
}
1