[V4RB] Does order in constructor make difference?

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Jan 24 19:05:55 CST 2004


on 1/23/04 8:21 PM, Christer Olsson at christer at ljusaideer.se wrote:

> I've spent the last five hours to hunt down a problem I've never seen before.
> We're adding two new tables ("Rabatter" and "Rabattrader") to our main app,
> and when we tried to add data to the new tables the app crashed every time on
> the second table.
> 
> It turned out that both tables were created just fine (i.e we could see and
> read them just fine with VAPP and ViSQL), but the baseObject for the second
> table ("Rabattrader"/"boRabattrader") had no fields...
> 
> After lot's of spellchecking, renamning and recreating of properties, methods
> and objects I just switched the order of the new tables in the database
> constructor - and suddenly everything worked just fine.
> 
> So, this didn't work:
> mInstallningar = new boInstallningar(self)
> mKunder = new boKunder(self)
> mArtiklar = new boArtiklar(self )
> mOrder = new boOrder(self)
> mOrderrader = new boOrderrader(self)
> mRabatter = new boRabatter(self)
> mRabattrader = new boRabattRader(self)
> 
> But this did:
> mInstallningar = new boInstallningar(self)
> mKunder = new boKunder(self)
> mArtiklar = new boArtiklar(self )
> mOrder = new boOrder(self)
> mOrderrader = new boOrderrader(self)
> mRabattrader = new boRabattRader(self)
> mRabatter = new boRabatter(self)
> 
> Any ideas?

Hi Christer, 

Yes, order does mater. When you use classes.
It does not mater, if you simply use Vdatabase and SQL.

This is why it is danger go to VAPP, add few tables with many  fields,
Then jump to RB and write code.

Most probably in this case you will not get the same order.

This is why you need create db/tables programmatically.

And this is why new feature of Valentina Studio (Generate Code) will be very
helpful for developers. It self will create code in the correct order.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list