Netherdrake
Member
- Joined
- Mar 17, 2010
- Messages
- 7
- Programming Experience
- Beginner
I have upgraded 16591 lines of code program from VB6 to .NET.
There was a lot of errors and warning that i fixed but i stuck on those.
First one comes here:
Couldn't resolve default property of object FoundBotName
Second one:
Variable BotsInSector is used before it has been assigned a value. A null reference exception could result at runtime.
And the last one:
Function HomeEncrypt doesn't return a value on all code paths. A null reference exception could occurs at runtime when the result is used.
Thanks in advance.
- Netherdrake
There was a lot of errors and warning that i fixed but i stuck on those.
First one comes here:
VB.NET:
Function FoundBotName(ByRef thebotname As String) As Object
Dim check As Short
'UPGRADE_WARNING: Couldn't resolve default property of object FoundBotName.
FoundBotName = True
Do
check = check + 1
If LCase(BotName(check)) = LCase(thebotname) Then Exit Function
Loop Until check = BotMax
'UPGRADE_WARNING: Couldn't resolve default property of object FoundBotName.
FoundBotName = False
End Function
Second one:
VB.NET:
Function BotsInSector(ByRef theSectorNumber As Short, ByRef theZone As Short) As String
Dim check As Short
Do
check = check + 1
If BotSector(check) = theSectorNumber And theZone = BotZone(check) And BotHull(check) <> 0 Then
BotsInSector = "," & BotShipClass(check) & BotShipKind(check) & BotName(check) & "," & BotGuild(check) & BotsInSector
End If
Loop Until check = BotMax
Return Nothing
End Function
Variable BotsInSector is used before it has been assigned a value. A null reference exception could result at runtime.
And the last one:
VB.NET:
Function HomeEncrypt(ByRef Message As String, ByRef ****youcodetheif As Short) As String
If Len(Message) = 0 Then Exit Function
Function HomeEncrypt doesn't return a value on all code paths. A null reference exception could occurs at runtime when the result is used.
Thanks in advance.
- Netherdrake
Last edited: