Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jan 29, 2020 10:37 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Old-style Constructor for MKS Plugin
PostPosted: Wed Mar 09, 2011 5:17 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
I'm trying to use Bob Delaney's MKS plugin for performing unit-based mathematics. I created an example straight out of the document that came with it:
dim x, a, t As MKS
a=new MKS("2 m/s^2")
t=new MKS("4 s")
x=(1/2)*a*t^2


Pretty simple. But when I go to compile I'm notified for the a and t constructor lines that: "Old-style constructor methods are no longer supported. You should use "Constructor" instead." It then tells me that the parameters are not compatible with the functions...

Can someone please enlighten me as to what "new/old" constructor methods they're talking about? Is this an issue with the RB code or the plugin itself?

Thanks! :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: Old-style Constructor for MKS Plugin
PostPosted: Wed Mar 09, 2011 6:00 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
In old versions, the constructor function was given the same name as the class. So if you have a class called MyNiftyClass which has a constructor that takes a string for an argument, the constructor was
Sub MyNiftyClass(s as String)

Now, the constructor has the name "Constructor" for all classes. So it is
Sub Constructor(s as String)

This is a problem with the plugin, not your code. Contact the plugin author for an update.


Top
 Profile  
Reply with quote  
 Post subject: Re: Old-style Constructor for MKS Plugin
PostPosted: Wed Mar 09, 2011 6:18 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
I was afraid that was the case. I sent an email to the creator, but I don't know if he still deals with such things... or is even alive. :(

Thanks, Tim!

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group