Comments

: Hello,: : I am using an string array to store a large text in a for loop. When the control moves to next , i want to clear the array value and store new value.some times the following Error comes.: : "un-time error '-2147418113(8000ffff): scan line index out of range": : Please Help me How to resolve this Problem.: : Thanks and Regards,: : P.Gerald Manickam: : Post some of your code, then it may be easier to help you.

[b][red]This message was edited by lionb at 2005-12-7 7:16:45[/red][/b][hr]: Hello,: : I am using an string array to store a large text in a for loop. When the control moves to next , i want to clear the array value and store new value.some times the following Error comes.: : "un-time error '-2147418113(8000ffff): scan line index out of range": : Please Help me How to resolve this Problem.: : Thanks and Regards,: : P.Gerald Manickam: : To clear all elements in Array you can use Erase Statement. See code example here:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vastmerasex.aspTo do manipulation with single elements you have to go through the loop and set elements' values to NULL/Empty string. Something like that[code]Fot I = 0 to Ubound(MyArray) If I = 10 Then MyArray(I) = vbNullString end if Next[/code]

: [b][red]This message was edited by lionb at 2005-12-7 7:16:45[/red][/b][hr]: : Hello,: : : : I am using an string array to store a large text in a for loop. When the control moves to next , i want to clear the array value and store new value.some times the following Error comes.: : : : "un-time error '-2147418113(8000ffff): : scan line index out of range": : : : Please Help me How to resolve this Problem.: : : : Thanks and Regards,: : : : P.Gerald Manickam: : : : : To clear all elements in Array you can use Erase Statement. See code example here:: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vastmerasex.asp: To do manipulation with single elements you have to go through the loop and set elements' values to NULL/Empty string. Something like that: [code]: Fot I = 0 to Ubound(MyArray): If I = 10 Then: MyArray(I) = vbNullString: end if : Next: [/code]: : :

Thanks lionb, I had never heard of Erase statement.......learn something new everyday.