1 Replies - 234 Views - Last Post: 15 January 2013 - 08:01 AM Rate Topic: -----

#1 gaja23.sg  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 11-January 13

error while copying some text from a char array to another char array

Posted 14 January 2013 - 11:39 PM

if suppose my "strarr" char array holds the following text
(i.e.)
strarr()="text0 \text1/ text2 text3

i wanted the text which is enclosed within \ /
so the index of \ is x and the index of / is y
s = x+1
en = y-1
the text which i want is between the index value s & en now ..
to copy it to a separate char array "usern()" i do the foll but i get an error as \
"variable 'usern' is used before it is been declared"

dim j As Integer = 0
for i As Integer = s to en
usern(j)=strarr(i)
j+=1
Next

Is This A Good Question/Topic? 0
  • +

Replies To: error while copying some text from a char array to another char array

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9204
  • View blog
  • Posts: 34,581
  • Joined: 12-June 08

Re: error while copying some text from a char array to another char array

Posted 15 January 2013 - 08:01 AM

Quote

"variable 'usern' is used before it is been declared"

That exactly explains what is going on. You need to declare (aka 'dim') the object 'usern'. You declared a variable 'j' so this shouldn't be a stretch to understand how to do that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1