When I use the code below, it compiles but the rest of the code doesn’t seem to work. When I take out the Substring part of it, it does.
-Steps
String theDate, theWeekDay;
if (ToTime(Time[0]) == ToTime(0, 0, 0))
{
theDate=ToDay(Time[0]).ToString().Substring(0,3);
theWeekDay=Time[0].DayOfWeek.ToString().Substring(4,8);
DrawTextFixed("day",theWeekDay, TextPosition.BottomRight);
DrawText("day"+Convert.ToString(ToDay(Time[0])),
theWeekDay+" "+theDate,0, Low[0]-TickSize*20, Color.Blue);
}
You’re going to have to provide more than just this snippet of code. What is the Time object you’re accessing via an indexer? Have you debugged this to see if
Time[0]actually has a value? My guess here would be thatTime[0]doesn’t return a value thatDayOfWeekcan work with henceSubstring(0,3)is being running against either an empty string or anullvalue