2 WARNINGS, please tell me how to fix

papaschir

New member
Joined
Nov 16, 2009
Messages
3
Programming Experience
Beginner
Here's my code

VB.NET:
Sub ReadForbidden()
		Dim num As Object
		Dim check As Short
		Dim curline As String
		'UPGRADE_WARNING: Couldn't resolve default property of object num. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		num = FreeFile
		On Error GoTo Skip
		'UPGRADE_WARNING: Couldn't resolve default property of object num. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		FileOpen(num, "forbidden.txt", OpenMode.Input)
		'UPGRADE_WARNING: Couldn't resolve default property of object num. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		Do Until EOF(num) = True
			check = check + 1
			'UPGRADE_WARNING: Couldn't resolve default property of object num. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
			curline = LineInput(num)
			ForbiddenIP(check) = curline
		Loop 
		IPForbiddenMax = check
		AddServerLogText("Forbidden List Loaded")
Skip: 
		'UPGRADE_WARNING: Couldn't resolve default property of object num. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
		FileClose(num)
	End Sub

I see the message wich tell me that the default property of object num couldn't be resolve, any1 can tell me how to fix thisone, thx.:mad:

And the nextone

VB.NET:
	Sub ReorganizeBountyList()
		Dim check As Short
		Dim check2 As Short
		Dim check3 As Short
		Dim tempmoney As Double
		'UPGRADE_WARNING: Lower bound of array temp was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
		Dim temp(32) As Short
		'UPGRADE_WARNING: Lower bound of array tempn was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
		Dim tempn(32) As String
		'UPGRADE_WARNING: Lower bound of array tempm was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
		Dim tempm(32) As Double
		'UPGRADE_WARNING: Lower bound of array tempt was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
		Dim tempt(32) As Short
		Do 
			check = check + 1
			check2 = 0
			Do 
				check2 = check2 + 1
				check3 = 0
				If temp(check) = 0 Then
					tempmoney = 0
				Else
					tempmoney = BountyMoney(temp(check))
				End If
				If tempmoney <= BountyMoney(check2) Then
					Do 
						check3 = check3 + 1
						If temp(check3) = check2 Then GoTo skipthis****
					Loop Until check3 = check
					temp(check) = check2
				End If
skipthis****: 
			Loop Until check2 = 32
		Loop Until check = 32
		check = 0
		Do 
			check = check + 1
			tempn(check) = BountyName(temp(check))
			tempm(check) = BountyMoney(temp(check))
			tempt(check) = BountyTime(temp(check))
		Loop Until check = 32
		check = 0
		Do 
			check = check + 1
			BountyName(check) = tempn(check)
			BountyMoney(check) = tempm(check)
			BountyTime(check) = tempt(check)
		Loop Until check = 32
	End Sub

'UPGRADE_WARNING: Lower bound of array tempn was changed from 1 to 0. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
 
If 'num' is supposed to be a number then don't declare it as type Object. Declare everything as the actual type they are supposed to be.

The second one is not something you have to fix. It's just information. In VB.NET all arrays are zero-based, e.g. an array with 10 elements has indexes 0 to 9, not 1 to 10.
 
As i understand, the num don't need to be declared as Object like this:
VB.NET:
Dim num As Object
But if it don't need to be declared as Object, what declaration i have to make for fix this warning ?

Sorry, pretty new in VB.NET :confused:
 
What is num supposed to be?

To me, it looks like it is supposed to be an integer, so perhaps that might be an acceptable type to use when declaring it.
 
Back
Top