Click here to Skip to main content
15,889,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I was wondering if anyone could show me or explain how to do the following

Say I have 3 names [there ARE hundreds, but lets just say 3]

Preview.Networks.Video.Trailers
Tool.Assisted
TVICaisa

using


vbs
AddonName = Replace(Replace(Replace(Replace(Replace(Replace(UpdateRepo("AddonName"),"'","''")," ","."),"(","."),")","."),"[","."),"]",".")
ANLine = AddonName
ServiceList = Split(ANLine , ".")
TheFirst = ServiceList(0)
TheSecond = ServiceList(1)
WScript.Echo TheFirst
WScript.Echo TheSecond
WScript.Echo AddonName



and of course it works on the 1st 2 names but dies on the 3rd because TheSecond ServiceList() is null.

how can I get around this?
Posted
Updated 22-Jul-11 18:56pm
v2

1 solution

to answer my own question.

I simply needed to

Scount = UBound(ServiceList) + 1
WScript.Echo Scount
If Scount = 1 Then
WScript.Echo ServiceList(0)
ElseIf Scount = 2 Then
WScript.Echo ServiceList(0)
WScript.Echo ServiceList(1)
End If

and bingo.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900