how to declare an array and initialize in one step similar to c
string myarry() = {"a", "b",....}
instead of element by element or devious split string?

Re: arry int question by de

de
Tue Sep 13 20:30:48 CDT 2005

myarray = Array("a","b","c")

or

dim myarray: myarray = Array("a","b","c")



Re: arry int question by Al

Al
Tue Sep 13 21:33:42 CDT 2005


"jg" <junk@mail.pls> wrote in message
news:OZRqkPMuFHA.2540@TK2MSFTNGP09.phx.gbl...
> how to declare an array and initialize in one step similar to c
> string myarry() = {"a", "b",....}
> instead of element by element or devious split string?

myarray = array("a","b","c")

/Al



Re: arry int question by jg

jg
Tue Sep 13 22:01:57 CDT 2005

thanks you all but
myarray = array("a","b","c")
wscript echo myarray(0) ' give me Microsoft VBScript compilation
error: Expected end of statement
so this does not seem to behave like a regular string array.

"Al Dunbar" <AlanNOSPAmDrub@hotmail.com> wrote in message
news:uk2paxMuFHA.444@TK2MSFTNGP15.phx.gbl...
>
> "jg" <junk@mail.pls> wrote in message
> news:OZRqkPMuFHA.2540@TK2MSFTNGP09.phx.gbl...
>> how to declare an array and initialize in one step similar to c
>> string myarry() = {"a", "b",....}
>> instead of element by element or devious split string?
>
> myarray = array("a","b","c")
>
> /Al
>
>



Re: arry int question by jg

jg
Tue Sep 13 22:09:28 CDT 2005

pardon me, please forget the prev reply but do take my thank you here.


I had a typo without realizing it.


Btw can someone tell me how to handle string array returned from vb dotnet?
the vb dot code snippet as follows
myarray() As String

Function xxx() as String()
....
return myarray
end Function

Thank you all again



"Al Dunbar" <AlanNOSPAmDrub@hotmail.com> wrote in message
news:uk2paxMuFHA.444@TK2MSFTNGP15.phx.gbl...
>
> "jg" <junk@mail.pls> wrote in message
> news:OZRqkPMuFHA.2540@TK2MSFTNGP09.phx.gbl...
>> how to declare an array and initialize in one step similar to c
>> string myarry() = {"a", "b",....}
>> instead of element by element or devious split string?
>
> myarray = array("a","b","c")
>
> /Al
>
>



Re: arry int question by jg

jg
Tue Sep 13 22:16:57 CDT 2005

thank you.

where would one such advance syntax?


I could not find it in the Dim statement syntax from Script56.CHM

"de Graff" <rjdegraff@shaw.ca> wrote in message
news:ej67wvMuFHA.908@tk2msftngp13.phx.gbl...
> myarray = Array("a","b","c")
>
> or
>
> dim myarray: myarray = Array("a","b","c")
>



Re: arry int question by Michael

Michael
Tue Sep 13 23:18:56 CDT 2005

jg wrote:
> thank you.
>
> where would one such advance syntax?
>
>
> I could not find it in the Dim statement syntax from Script56.CHM

Download details: Windows Script Documentation
http://www.microsoft.com/downloads/details.aspx?FamilyID=01592c48-207d-4be1-8a76-1c4099d7bbb9&DisplayLang=en

See the Array function docs, not the Dim statement

>
> "de Graff" <rjdegraff@shaw.ca> wrote in message
> news:ej67wvMuFHA.908@tk2msftngp13.phx.gbl...
>> myarray = Array("a","b","c")
>>
>> or
>>
>> dim myarray: myarray = Array("a","b","c")

--
Michael Harris
Microsoft MVP Scripting





Re: arry int question by Al

Al
Wed Sep 14 02:58:41 CDT 2005


"jg" <junk@mail.pls> wrote in message
news:uCn7XmNuFHA.3256@TK2MSFTNGP09.phx.gbl...
> pardon me, please forget the prev reply but do take my thank you here.
>
>
> I had a typo without realizing it.
>
>
> Btw can someone tell me how to handle string array returned from vb
> dotnet? the vb dot code snippet as follows
> myarray() As String
>
> Function xxx() as String()
> ....
> return myarray
> end Function

This is a vbscript group, not a vb .net group.

/Al



Re: arry int question by jg

jg
Thu Sep 15 10:44:21 CDT 2005

I know but this is a question of how to handle array in VBSCRIPT when an
array is return from an dot.net object.

"Al Dunbar" <AlanNOSPAmDrub@hotmail.com> wrote in message
news:Ot9sAnPuFHA.3896@TK2MSFTNGP15.phx.gbl...
>
> "jg" <junk@mail.pls> wrote in message
> news:uCn7XmNuFHA.3256@TK2MSFTNGP09.phx.gbl...
>> pardon me, please forget the prev reply but do take my thank you here.
>>
>>
>> I had a typo without realizing it.
>>
>>
>> Btw can someone tell me how to handle string array returned from vb
>> dotnet? the vb dot code snippet as follows
>> myarray() As String
>>
>> Function xxx() as String()
>> ....
>> return myarray
>> end Function
>
> This is a vbscript group, not a vb .net group.
>
> /Al
>
>