array structure

  • Thread starter Thread starter a7zulu
  • Start date Start date
A

a7zulu

Does anyone know what is the datatype of an array of strings in Excel?

for an array of doubles it is usually a FPARRAY structure

typedef struct FPARRAY{
unsigned short iRows,
iCols;
double dArray[FPARRAY_SIZE];
} FPARRAY;


What is the data structure for an array of Strings?


Thanks
 
C language and Basic do no store strings in the same manner. Because in
Basic you can insert characters in the middle of string the STRING data type
is not continous.

The characters in strings are bytes. You can use the ASC function to get
the value of the string characters and move them into an arrary something
like the following

Dim packstring
Dim PackArray(100) as byte

for stringcount = 1 to len(MyString)

PackArray(stringcount) = Asc(mid(MyString,stringcount,1))

next stringcount

I think ther maybe a Basic statement to do this automatically. It beens
years since I've had this problem.
 
C language and Basic do no store strings in the same manner. Because in
Basic you can insert characters in the middle of string the STRING data
type
is not continous.

The characters in strings are bytes. You can use the ASC function to get
the value of the string characters and move them into an arrary something
like the following

Dim packstring
Dim PackArray(100) as byte

for stringcount = 1 to len(MyString)

PackArray(stringcount) = Asc(mid(MyString,stringcount,1))

next stringcount

I think ther maybe a Basic statement to do this automatically.

If you are willing to start your Byte array with a lower bound of zero, then
yes, there is...

Dim PackString As String
Dim PackArray() As Byte
PackString = "Whatever text you would like"
PackString = StrConv(PackString, vbFromUnicode)

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top