472,125 Members | 1,414 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

Can someone tell me wath i'm doiing wrong

Jan
This is my problem:
When i have more than 3 lines of text in de tempArray. Iget the following
message:

An unhandled exception of type 'System.NullReferenceException' occurred in
Allen's Woodshop.exe

Additional information: Object reference not set to an instance of an
object.

The program holds on the line:
'strItem=strTextline(intFormTotal).Split(";")'

I'm completly stuck at the moment, so i hope someone can help out of this
mess. Thankx a lot

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

Dim strItem(3), strTempItem(3) As String
Dim myComp, Teller As Integer

counter = 0

For intFormTotal = 0 To strTextline.GetUpperBound(0)

strItem = strTextline(intFormTotal).Split(";")
strTempItem = tempArray(counter).Split(";")

myComp = StrComp(strItem(0), strTempItem(0),CompareMethod.Text)

If myComp = 0 Then
strItem(3) = strTempItem(3)
strTextline(intFormTotal) = Join(strItem, ";")

counter += 1
If tempArray.GetUpperBound(0) = counter Then

Exit For
End If

Else
strItem(3) = strItem(3)
strTextline(intFormTotal) = Join(strItem, ";")

If tempArray.GetUpperBound(0) = counter Then
Exit For
End If

End If
Next

FForm1.lstWoodshop.Items.Clear()
intFormTotal = 0
Do Until intFormTotal = 24
FForm1.lstWoodshop.Items.Add(strTextline(intFormTo tal))
intFormTotal += 1
Loop

End Sub
Nov 20 '05 #1
4 1951
"Jan" <ca*****@planet.nl> schrieb
This is my problem:
When i have more than 3 lines of text in de tempArray. Iget the
following message:

An unhandled exception of type 'System.NullReferenceException'
occurred in Allen's Woodshop.exe

Additional information: Object reference not set to an instance of
an object.

The program holds on the line:
'strItem=strTextline(intFormTotal).Split(";")'

I'm completly stuck at the moment, so i hope someone can help out of
this mess. Thankx a lot


I can not reproduce it because several variable declarations are missing.

I declared Dim counter, intFormTotal As Integer, but how am I to declare
tempArray and strTextline?
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #2
"Jan" <ca*****@planet.nl> wrote in message
news:l2******************************@40tude.net.. .
This is my problem:
When i have more than 3 lines of text in de tempArray. Iget the following
message:

Dim strItem(3), strTempItem(3) As String


if you declare an array w 3 places (4 if you are starting from 0) it can
only hold 3 things

don't have time to go over it completely but i think this could be the
problem

eric
Nov 20 '05 #3
Jan
On Thu, 6 Nov 2003 15:30:48 +0100, Armin Zingler wrote:
"Jan" <ca*****@planet.nl> schrieb
This is my problem:
When i have more than 3 lines of text in de tempArray. Iget the
following message:

An unhandled exception of type 'System.NullReferenceException'
occurred in Allen's Woodshop.exe

Additional information: Object reference not set to an instance of
an object.

The program holds on the line:
'strItem=strTextline(intFormTotal).Split(";")'

I'm completly stuck at the moment, so i hope someone can help out of
this mess. Thankx a lot


I can not reproduce it because several variable declarations are missing.

I declared Dim counter, intFormTotal As Integer, but how am I to declare
tempArray and strTextline?


I have declared them with:
dim tempArray(25) as string
dim strTextline(25) as string

thnx for your attention
Nov 20 '05 #4
"Jan" <ca*****@planet.nl> schrieb

I can not reproduce it because several variable declarations are
missing.

I declared Dim counter, intFormTotal As Integer, but how am I to
declare tempArray and strTextline?


I have declared them with:
dim tempArray(25) as string
dim strTextline(25) as string

thnx for your attention
There are no strings in the array. The array can hold 26 strings (index 0 to
25) but you don't store strings in the array.
--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Helmut Giese | last post: by
40 posts views Thread by aslamhenry | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.