![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2009
Posts: 10
Rep Power: 0
![]() |
Error With Substring Command
I use visual studio 2008 and i am trying to pick out specific desgnator from a string and then display the next 5 charecters.
I get "ArgumentOutOfRangeException was unhandled" Startindex cannot be less than zero. Parameter name: Startindex My code dim networkstream as networkstream = tcpclient.getstream() if networkstream.canwrite and networkstream.canread then dim bytes(tcpclient.recievebuffersize) as byte networkstream.read(bytes, 0, CInt(tcpclient.recievebuffersize)) dim returndata as string = encoding.ascii.getstring(bytes) dim slpart as string dim possl as integer possl = returndata.indexof("Sl") slpart = returndata.substring(possl, 7) if slpart = 7 then label1.text = slpart else end if |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Aug 2009
Posts: 10
Rep Power: 0
![]() |
Re: Error With Substring Command
if I change it to Int(possl = returndata.indexof("sl") it stops lookinf for sl in the string coming from the network stream
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make your/my own command line program | FoggyDreamer | C | 3 | Mar 21st, 2009 6:40 PM |
| How to Fire a command From FILE | jdKool | C | 7 | Jan 10th, 2009 3:24 PM |
| Trying to pipe output system command results directly into a variable | VernonDozier | C++ | 5 | Jan 6th, 2008 2:39 AM |
| Command Prompt | SkyPioneer | Coder's Corner Lounge | 5 | May 3rd, 2006 10:07 PM |
| system () command in Borland C++ Bldr. 4 | L7Sqr | C++ | 14 | Jun 18th, 2005 8:15 PM |