DOpusFactory.Blob.ToArray recommendations

DOpusFactory.Blob.ToArray(start, end, type)
start Default 0
end Default self.size
type is two const (VT_UI1, VT_VARIANT)

这样是不是更灵活一些?
Is this more flexible?

Can you provide an example where this would be more useful?

Currently, DOpusFactory.Blob.ToArray will automatically do these things in accordance with the contents of the blob, and you can also tweak it with DOpusFactory.Blob.Set and DOpusFactory.Blob.Resize.

Third parameter (type) VT_VARIANT would not be needed because it already gets automatically set to appropriate one depending whether your script is written in VBScript or JScript.

dim blobTemp, blobValue, arrTemp
Set blobTemp = DOpus.Create.Blob()
Set blobValue  = DOpus.Create.Blob(1,2,3,4,5,6,7,8,9)

If only partial values are required

blobtemp.CopyFrom(blobValue, 0, 5, 4) ' Take a partial value to an array
arrTemp = blobtemp.tovbarray

If so, it would be much simpler.
arrtemp = blobValue.toarray (5, 4, VT_Variant)

1 Like

We'll add this in the next version, thanks for the suggestion!

1 Like