Hello,
I am new to xojo and mostly new to programming … therefore I have a lot of questions
Reading the book “Introduction to programming with Xojo” I decided to start with a ToDo list manager for my training.
So, I created a class “Project” which has, among others, the property “DueDate” of type “Date”.
During startup of the app I generate three objects from this class, to have something to work with and save them in an array.
It looks like this (showing only one object but the code is the same for all three):
Dim p As Project
p = New Project
p.Titel = "Impara la vela"
p.Detail = "Proviamo a usare un laser sul lago di Lugano"
p.Status = True
p.DueDate.Day = 3 <<--- here I get the "NilObjectException"
MyProjects.Append(p)
I tried to assign a due date in all possible ways I can think of until I simplified to “Day”. Normally the property would get a date from a text field.
So, “p” is my object. “DueDate” is a property of type “Date” and the error means that the object does not exist, correct?
Since “p” does exist (p = New Project) it could have to do with “DueDate”. I learned that “Date” is also a class but I don’t instantiate it … I thought that this is done by some sort of miracle by xojo since it is part of my class
And yes, I searched the forum, I googled (which leads most of the time back to forum entries) and I scanned the above mentioned book, but I was not able to find a solution.
I know, that it is my fault, but I am not abel to discover it.
Thanks in advance for your help!
Regards,
thomas