PC Review


Reply
Thread Tools Rate Thread

array structure

 
 
a7zulu@gmail.com
Guest
Posts: n/a
 
      29th Jun 2007
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      29th Jun 2007
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.
"(E-Mail Removed)" 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
>
>

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      30th Jun 2007
>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to marshal an array of unmanaged structure into a managed array of structures. amags kumar via .NET 247 Microsoft Dot NET Framework 0 4th Jun 2005 01:55 AM
How to convert a structure including an array into a byte stream / array? ORC Microsoft Dot NET Compact Framework 2 2nd Nov 2004 07:43 PM
Re: Copying unmanaged memory pointer of structure to managed structure array Mattias Sjögren Microsoft VC .NET 0 28th Aug 2004 03:19 PM
How to marshal a structure with a structure array inside? =?Utf-8?B?Q2FtaWxvIFRlbGxlcw==?= Microsoft C# .NET 1 12th Apr 2004 06:46 PM
Structure array inside structure when passing reference to C++ Mikko Penkkimäki Microsoft C# .NET 1 29th Oct 2003 03:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:39 PM.