Hi,
This is a problem that I had a few times and I would like to know how to solve that in the future.
If a class has private constructor(s) (example: System.Globalization.Calendar) then I can't use that.
if I try
message System.Globalization.Calendar:GetDayOfMonth(today) view-as alert-box.
I get error 14633 ==> must use an object-instance, not the class itself
When I try to create an object instance i get error 15107 ==> you cannot create an instance of because it's an abstract class.
So how can I use that System.Globalization.Calendar class in Progress?
Thanks
Didier
<ProgressEmailLogo-png_2D00_150x42x2-png> Update from Progress Community
DenDuze Hi Marian, Mike,
Thanks, That makes sense but how do you know - from the Class Browser - what classes have implemented this abstract class.
I can guess by the name but I also guess that's not garanteed (it's best practice but not mandatory - or is it).
Thanks, I can test further ...
You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.
The Calendar class is abstract and GetDayOfMonth is an abstract method.
You will have to use an actual calendar implementation like the gregorian calendar or
DEFINE VARIABLE oCalendar AS System.Globalization.Calendar NO-UNDO. . oCalendar = NEW System.Globalization.GregorianCalendar (). MESSAGE oCalendar:GetDayOfMonth (TODAY).
The Calendar class is abstract and GetDayOfMonth is an abstract method.
You will have to use an actual calendar implementation like the gregorian calendar or
DEFINE VARIABLE oCalendar AS System.Globalization.Calendar NO-UNDO. . oCalendar = NEW System.Globalization.GregorianCalendar (). MESSAGE oCalendar:GetDayOfMonth (TODAY).
Than’s because it’s an abstract class, you might try some of the available implementations like GregorianCalendar that has a public constructor.
Actually even better should be:
oCalendar = System.Globalization.CultureInfo:CurrentCulture:Calendar.
Hi Marian, Mike,
Thanks, That makes sense but how do you know - from the Class Browser - what classes have implemented this abstract class.
I can guess by the name but I also guess that's not garanteed (it's best practice but not mandatory - or is it).
Thanks, I can test further ...
<ProgressEmailLogo-png_2D00_150x42x2-png> Update from Progress Community
DenDuze Hi Marian, Mike,
Thanks, That makes sense but how do you know - from the Class Browser - what classes have implemented this abstract class.
I can guess by the name but I also guess that's not garanteed (it's best practice but not mandatory - or is it).
Thanks, I can test further ...
You received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.