[Valentina] Re: Vdb files

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jan 20 11:28:59 CST 2003


on 1/20/03 4:03 AM, Keith DeLong at delong at redcort.com wrote:

>> Valentina use that info to do next string operation
>> 
>>   Substr( "dbname.vtc", "vtc" )
> 
> Why the Substr at all?  Why make create parse a name that you already have a
> constant set for with ValentinaSetExtensions?
> 
>> As result, Valentina can extract the basic name of database "dbname".
>> As result, Valentina can now buld rest names "dbname.dat", ...
> 
> This is not a good solution in my opinion. The developer get wild results if
> he doesn't set first parameter ValentinaSetExtensions to the same extension
> passed when the create command is called.
> 
> Here's how it works from the developer point of view. If I want custom
> extensions:
> 
> 1. I must set custom extensions via ValentinaSetExtensions
>   ValentinaSetExtensions "XXX", "dat, "blb", "ind"
> 
> 2. I must remember to always append any user supplied name with the same
> data file extension supplied to ValentinaSetExtensions.
>   a.  get name from user.
>   b.  add my data file extension
>   c.  db.Create( "dbname.xxx" )
> 
> Why the duplicate effort and tracking?
> 
> 3. If I accidentally do
> 
> ValentinaSetExtensions "XXX", "dat, "blb", "ind"
> //and then later...
> db.Create( "dbname.vtc" )
> 
> Your Substr( "dbname.vtc", "XXX" ) leads to:
> dbname.vtc
> dbname.vtc.dat
> dbname.vtc.blb
> dbname.vtc.ind
> 
> Do you see how confusing this is from a developers point of view? (This is
> just what confused me in the first place). I see HOW it happens based on
> your explanation above. But it is not at all obvious for the developer.
> 
> You're making me match the first parameter of ValentinaSetExtensions with
> the extension of the create file name with no error checking or clue what is
> happening if I fail to do this.
> 
>> I hope now it is more clear.
> 
> I understand how it works, but I don't think you've done a good job here.
> :-)
> 
> It still seems to me it would be so much more straight forward if the create
> just received the filename. The  Substr( "dbname.vtc", "vtc" ) would go away
> and create could simply rely (just like the other 3 files) on  the
> parameters of ValentinaSetExtensions.
> 
> If I'm missing some C++/cross platform logic that I don't understand. Please
> forgive me. In this case, I'd request that "dbname.vtc" and "vtc" should be
> compared and an error generated if the ValentinaSetExtensions constant
> doesn't match the file extension passed to the create command. What a
> mess...

You really do not see all palyers here.

1) YES, it is easy for Create() get just name and build that name.
But also exits Open().

You do not take into account that open() can get dbs as with .vdb extension
if they come from Windows, so without extensions !!!!!!!!!
        THIS IS SHOW STOPPER for your logic.

You do not take into account that one can send strings from code, other can
send strings of db name from OpenDialog.

And it seems the main miss for you is that

        "ruslan.zasukhin.db"
        "my.music.db.old"

are legal file names for Win and X.
        
And they DO NOT have yet extensions !!!!
So when you do 

        Db.Create( "ruslan.zasukhin.db" )
 
What you expect to get?
I expect to get

        ruslan.zasukhin.db.vdb
        ruslan.zasukhin.db.dat
        ruslan.zasukhin.db.blb
        ruslan.zasukhin.db.ind

This is why I need SUBSTR().
This is WHY kernel MUST know "vdb" extension.

I cannot just find the first DOT.
Things are more complex....

-- 
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://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list