Conclusion

Use the following points as your basic rules for handling dates in your Visual Basic programs:

  • Always use the Date data type for holding and manipulating dates.

  • If you have to assign dates that lack century information, always use a known and documented algorithm for your interpretation or expansion of them.

  • Be aware of all of the leap year rules in any routines you write that manipulate dates.

  • Never manipulate dates as strings.

  • Wherever possible use Visual Basic's built-in date manipulation capabilities, which are many and varied.

  • Assume nothing.

Many developers are rather blasé about Visual Basic's Year 2000 compliance, assuming that since the Date data type can store dates up to 9999, the language is fully compliant and they have nothing to worry about. Given that Visual Basic is without a doubt one of the world's most popular programming languages, this attitude is worrisome, to say the least. I hope this chapter has revealed that this is by no means the whole story. Not only must the language be compliant, so must the programmers. Visual Basic is like a loaded gun: it's only safe in the right hands. When used sensibly it is easy to create fully compliant applications; unfortunately, writing noncompliant ones is even easier.



Ltd Mandelbrot Set International Advanced Microsoft Visual Basics 6. 0
Advanced Microsoft Visual Basic (Mps)
ISBN: 1572318937
EAN: 2147483647
Year: 1997
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net