|
-
Jan 2nd, 2004, 10:55 AM
#1
Thread Starter
Hyperactive Member
sized strings in vbs
explanation
Im calling a method of a COM object that takes a sized string as a parameter and fills it with the adapternames on the computer.
VB Code:
'dim sized string
Dim AdapterNames as String * 1000
Dim AdapterList as String
'call the method to fill the string
vpacket.GetAdapterNames(AdapterNames)
AdapterList=Split(AdapterNames,vbNullChar)
This works fine and I get a Array of Strings with the adapter names.
But, Im not sure how to go about doing the same thing in vbs
heres what i was trying.
VB Code:
Dim AdapterNames
set vpacket=createobject("vbPcap.vbPacket")
AdapterNames=string(1000," ")
vpacket.GetAdapterNames(AdapterNames)
The AdapterNames doesnt get filled with the data like in vb.
Actually it doesnt get changed at all.
Am i trying something that cant be done in vbs?
Can someone point me in the right direction here.
thanks
packetvb
-
Jan 2nd, 2004, 03:44 PM
#2
Frenzied Member
VBScript only has one data type...Variant.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jan 5th, 2004, 08:11 AM
#3
Fanatic Member
If you just want a string 1000 characters long you can use the Space(1000) function.
I'm not sure that it will help though!
-
Jan 5th, 2004, 11:45 AM
#4
Frenzied Member
If you just want the first 1,000 why not just use Left(YourStuff, 1000)?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|