Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default array structure

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default array structure

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.
" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default array structure

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cant pass array to excel from c++ using xloper structure malayhk Excel Worksheet Functions 0 November 4th 09 09:09 AM
Please help me... with Case Structure LSB M Excel Worksheet Functions 3 July 12th 06 09:31 AM
if structure help filo666 Excel Programming 4 March 1st 05 08:37 PM
how to union two array with same structure miao jie Excel Programming 2 October 13th 04 04:14 PM
Structure of If...Else in VBA John Wilson Excel Programming 2 July 30th 03 04:33 AM


All times are GMT +1. The time now is 09:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"