0

VarArrayAsPSafeArray is not available in Delphi 5.0 What is the equivalent of that in Delphi 5.0? I wanted exactly do the task discussed here. How to convert Array of bytes to Variant Have a huge byte array and want to convert to variant. Just assignment takes upto 4 seconds!

Community
  • 1
  • 1
Manoj
  • 1

1 Answers1

5

VarArrayAsPSafeArray() simply extracts the PSafeArray pointer from inside of a Variant. You can do that directly:

V := VarArrayCreate([0, High(a)], varByte);
SafeArray := PSafeArray(TVarData(V).VArray);
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770