Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StringIndexOutOfBoundsException

 
Frederik Bolding
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello there.

I am having a problem with my code..
It is force closing when i run it.
With the error: StringIndexOutOfBoundsException

My code:



- Frede1012
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.
 
Frederik Bolding
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You didn't say in which line this happens, so I'm guessing either line 42 or 43. What is the value of "n"? If it's -1 or equal to the length of "result" you're in trouble.


I dont really know, i got help on an irc and did this.
But it is still not working.
Im trying to get the first two lines of the memoryinfo thingy.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just noticing that lines 41 to 45 are not part of any method; it looks like they need to go between lines 12 and 13.
 
Frederik Bolding
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay that fixes the error.
But it still shows the whole meminfo instead of only output string?
 
Frederik Bolding
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind!
Thanks for the help!

/solved
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic