S shaffnert03 Member Licensed User Longtime User Nov 29, 2013 #1 When I debug my current project it will compile fine, but when I try to compile it in release mode I get a compile error with types not matching. The line I'm getting the error at is Code: Copy NextBirthday = DateTime.DateParse(DateTime.GetMonth(DateTime.DateParse(Row(2))) & "/" _ & DateTime.GetDayOfMonth(DateTime.DateParse(Row(2))) & "/" & DateTime.GetYear(DateTime.Now)) where NextBirthday is defined as a Period type and Row(2) contains a date string. The compile error I get is below. Anyone know what's going on here and how to fix it? Compile Error: Parsing code. 0.05 Compiling code. 0.16 Compiling layouts code. 0.00 Generating R file. 0.04 Compiling generated Java code. Error B4A line: 112 NextBirthday = DateTime.DateParse(DateTime.GetMonth(DateTime.DateParse(Row(2))) & \ javac 1.7.0_17 src\anywheresoftware\b4a\samples\customlistview\main.java:372: error: inconvertible types _nextbirthday = (anywheresoftware.b4a.samples.customlistview.dateutils._period)(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetMonth(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(_row[(int) (2)])))+"/"+BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetDayOfMonth(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(_row[(int) (2)])))+"/"+BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetYear(anywheresoftware.b4a.keywords.Common.DateTime.getNow())))); ^ required: _period found: long 1 error
When I debug my current project it will compile fine, but when I try to compile it in release mode I get a compile error with types not matching. The line I'm getting the error at is Code: Copy NextBirthday = DateTime.DateParse(DateTime.GetMonth(DateTime.DateParse(Row(2))) & "/" _ & DateTime.GetDayOfMonth(DateTime.DateParse(Row(2))) & "/" & DateTime.GetYear(DateTime.Now)) where NextBirthday is defined as a Period type and Row(2) contains a date string. The compile error I get is below. Anyone know what's going on here and how to fix it? Compile Error: Parsing code. 0.05 Compiling code. 0.16 Compiling layouts code. 0.00 Generating R file. 0.04 Compiling generated Java code. Error B4A line: 112 NextBirthday = DateTime.DateParse(DateTime.GetMonth(DateTime.DateParse(Row(2))) & \ javac 1.7.0_17 src\anywheresoftware\b4a\samples\customlistview\main.java:372: error: inconvertible types _nextbirthday = (anywheresoftware.b4a.samples.customlistview.dateutils._period)(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetMonth(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(_row[(int) (2)])))+"/"+BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetDayOfMonth(anywheresoftware.b4a.keywords.Common.DateTime.DateParse(_row[(int) (2)])))+"/"+BA.NumberToString(anywheresoftware.b4a.keywords.Common.DateTime.GetYear(anywheresoftware.b4a.keywords.Common.DateTime.getNow())))); ^ required: _period found: long 1 error
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2013 #2 NextBirthday should be declared as Long. See the signature of DateTime.DateParse: http://www.b4x.com/android/forum/pages/results/?query=datetime.dateparse&page=1 Upvote 0
NextBirthday should be declared as Long. See the signature of DateTime.DateParse: http://www.b4x.com/android/forum/pages/results/?query=datetime.dateparse&page=1
S shaffnert03 Member Licensed User Longtime User Dec 1, 2013 #3 Ahh, that did it, don't know how I missed that. Thanks so much for the help! Upvote 0