Hi there,
I‘m pretty new to xojo and have a problem with my datetime object.
For each session in my web app I store the current time and two other datetime objects (for calculating, are also current time) which are initiated through a constructor in the session.
It should work like followed:
When I push a button it should subtract an hour from the datetime objects in the session which are for calculating, but everytime I push the button I get a Nilobjectexception because if you look at the datetime objects in the debugger there isn‘t a value instead of it - Nil.
The code looks like this:
Constructor:
Var currTime As DateTime
Var fromHour As DateTime
Var toHour As DateTime
currTime = DateTime.Now
FromHour = DateTime.Now
ToHour = DateTime.Now.AddInterval(0,0,0,1)
When I push the button a method from another class gets called to subtract one hour of fromHour and toHour.
Class Method:
Session.fromHour = session.fromHour.subtractInterval(0,0,0,1)
session.toHour = session.toHour.subtractInterval(0,0,0,1)
Webpage1.timeLabel.Text = session.fromHour.ToString + „ - „ + session.toHour.ToString
The exception is raised when it should subtract one hour in the class method.
I hope I could explain my problem good enough for you to understand it.