• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • 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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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