PC Review


Reply
Thread Tools Rate Thread

Array() vs thing()?

 
 
=?Utf-8?B?TWF1cnkgTWFya293aXR6?=
Guest
Posts: n/a
 
      9th Jul 2007
Can someone explain the difference between the Array(...) syntax and the
thing() as string syntax?

I wrote a bunch of subs using the thing() as String API, but it turns out
that the underlying COM object requires Array's. I thought these were the
same thing, but no I see they are not, and I have to re-write them all
(darn). But I'd like to be sure I understand them first!

Also, if I have a Dim MyArray(10) As Integer and want to turn that into an
Array, is there an easy way to do this? If so, I could convert in a single
sub and save re-writing a lot of code "here and there".

Maury

 
Reply With Quote
 
 
 
 
George Nicholson
Guest
Posts: n/a
 
      10th Jul 2007
afaik:

Dim thing() as string ' = a string array
Dim MyArray(10) as integer '= a fixed integer array

Dim thing() '= a variant array

Per VBA Help the Array() function returns a Variant array. It may simply be
that the COM expects a Variant type, so its possible that the only code you
need to change is replace "as String" with "as Variant" (that's all a
rewrite using Array() would do...).

HTH,

"Maury Markowitz" <(E-Mail Removed)> wrote in
message news:0F7586C6-36D1-444A-AEAB-(E-Mail Removed)...
> Can someone explain the difference between the Array(...) syntax and the
> thing() as string syntax?
>
> I wrote a bunch of subs using the thing() as String API, but it turns out
> that the underlying COM object requires Array's. I thought these were the
> same thing, but no I see they are not, and I have to re-write them all
> (darn). But I'd like to be sure I understand them first!
>
> Also, if I have a Dim MyArray(10) As Integer and want to turn that into an
> Array, is there an easy way to do this? If so, I could convert in a single
> sub and save re-writing a lot of code "here and there".
>
> Maury
>



 
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
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R Microsoft Excel Programming 3 13th Nov 2007 04:08 PM
Interface -- C# thing or .NET thing gz Microsoft C# .NET 5 11th Oct 2007 09:24 PM
meaning of : IF(Switch; Average(array A, array B); array A) =?Utf-8?B?RFhBVA==?= Microsoft Excel Worksheet Functions 1 24th Oct 2006 06:11 PM
Sub(Thing as Object) {thing = new Thing.GetType} ? Kristian Frost Microsoft VB .NET 1 22nd Sep 2006 02:34 PM
Is it a configuration thing or a version thing? Jack Sheet Microsoft Outlook Discussion 4 17th Feb 2006 06:43 PM


Features
 

Advertising
 

Newsgroups
 


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