VBCorLib for VB6

Wednesday, December 21, 2005

My Favorite String Function...

So there I am typing away on a string literal. I have to include variable values within the string, so I unquote, hit ampersand, variable name, ampersand, and requote to continue with the string literal. Many times I'll need to format the variable value, too. And I have to do this for every variable I need. And if I use the same variable more than once, I have to type it more than once.

So what do I do now? I have become reliant on cString.Format to create the complex strings I need. Since cString is already publicly available, it's a simple process to insert values, formatted or not, duplicated or not without the quoting jargon.

I write error messages for my exceptions all the time. Usually I'll include a valid value or value range in the message. Now I automatically start string building with cString.Format.

Here is a typical exception message:
cString.Format("Valid values are from {0} to {1:n0}.", 1, 999999)

This outputs the following:
Valid values are from 1 to 999,999.

The cString.Format function uses an already declared StringBuilder and simply calls the AppendFormat function. The StringBuilder is cleared before each call.

So this provides me with a very quick, painless, and easy way to create my formatted strings. I don't think I could go back to the old way.

-Kelly

Monday, December 05, 2005

Supporting Asynchronous FileStream Class

Well dang, the current constructor NewFileStream() doesn't include the useAsync optional argument with the intent to implement it later. So now I have a dilema. I have 3 options:

1. Break Binary Compatibility to include the new argument.
2. Add a second constructor NewFileStreamAsync(), keeping Binary Compatibility.
3. Don't add asynchronous I/O capabilities to the FileStream class.

So now I'll be thinking about it....

Kelly

Saturday, December 03, 2005

What's Next?

What's on the horizon with VBCorLib? The DLL itself will probably not be expanded any further. After I finish up a couple things with it, I'll begin researching the capabilities of the System.dll from .NET and see what can be reproduced in VB6. The VBSystem.dll will be the first DLL built using VBCorLib on the way to expand the VB.EXT framework. It will be an exciting time as I will be able to focus on other systems instead of lower-level code.

As for what I have to finish up on VBCorLib. Well, the FileStream class isn't quite right, so I must fix that. It shouldn't be anything critical for anyone. I then want to support asychronous file IO in the FileStream class. That's really about all that's left. It is possible that VBCorLib will be expanded as new parts of the framework emerge requiring increase support from the core library.

So, in the near future I should be starting work on VBSystem.dll, the 2nd dll of the VB.EXT framework.

And ideas are always welcome. I can't say if they will make it into the VBSystem.dll, as I'll be trying to keep it with the same context as the .NET version. There may be another dll in which a suggestion would fit and be implemented at a later date.

Off I go!

Kelly