V4RB - TableCount counts temp tables as well

Erne ernestogiannotta at tiscalinet.it
Mon Mar 12 04:33:53 CDT 2007


Hello Ruslan,

I found that the DB.TableCount() counts also the internal temp tables  
like "_jointable1" etc...

is this correct behaviour?

I mean, developer should know nothing about the internals of  
implementation and thus shouldn't care to deal with these (from his  
point of view alien) tables

Maybe for those who care could be added a new function like  
DB.TrueTableCount() and let TableCount return only the count of those  
created by the developer...

...mmm but I see a gotcha here

What if developer creates some temp tables himself?
These of course should be counted by TableCount() function but then  
trying to access them via DB.Table(idx) could interfere with some  
internally created temp table and thus return the wrong object

Well, I think kernel should take responsability to keep track of its  
internals and account for the proper offset in this case

e.g.
DB has tables "Table1" and "Table2"
Valentina creates own internal table "_JoinTable1"
User creates new "TempTable"

as things stand now DB.TableCount() will return 4 and DB.Table(3)  
will return "_JoinTable1"
I propose that DB.TableCount() should return 3 and DB.Table(3) should  
return "TempTable"
and DB.TrueTableCount() should return 4 and DB.TrueTable(3) should  
return "_JoinTable1"

what do you think?

Cool Runnings,
Erne.

/ |\ |\  | /
– |/ | \ | –
\ |\ |  \| \



More information about the Valentina mailing list