• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

How to convert a array

I have an array defined as varient, I need to convert it into single, but I do not know the dimension of the array, ie. how big it is.

Any suggestion?

Dim BLOBdata() As Single

How to define the dimension?
0
turbot_yu
Asked:
turbot_yu
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you explain more in detail what exactly you are trying to achieve, it is not clear for me.

if you don't know the dimensions, use UBOUND(variable) and LBOUND(variable) to know the upper and lower bound.
if you assume that it has more than 1 dimension:
UBOUND(variable, 0) get's the first dimension's upper bound, UBOUND(variable, 1) the one of the second etc. until ubound returns -1

0
 
turbot_yuAuthor Commented:
I get a array back from a function return,
a(..., x,.... )

x is an array of varient,
Now I need to convert x to a Single type array, how to do it?
0
 
turbot_yuAuthor Commented:
I tried Dim BLOBdata(UBound(Waveform)) As Single

but it said constant data required.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have to make that in 2 lines:
'first declare the array variable without size
Dim BLOBdata() As Single
'now redimension the array
REDim BLOBdata(UBound(Waveform)) As Single
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now