Variants and Open Arrays Parameters

When you are working with variants, most variant to string conversion code will work as expected, as there is a new variant type:

varUString = $0102;

{ Unicode string 258 } {not OLE compatible}

All variant-based conversions should work properly, not causing much difference in your variant-related code, unless you have to interact to COM or OLE automation, in which case you still have to use the WideString type (as before, so this is not an actual change).

When working with variant open array parameters, and other untyped data structures, instead, the AnsiString and UnicodeString cases must be handled specifically. For example the TVarRec structure has now three distinct string-related entries (it used to have two), among many other types I've omitted: type

TVarRec = record case Byte of vtString: (VString: PShortString);

vtAnsiString: (VAnsiString: Pointer); vtUnicodeString: (VUnicodeString: Pointer);

If you process an open array parameter with a case statement that has specific branches for strings, you have to consider this new alternative.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment