Skip to content

Commit

Permalink
Fix warnings by converting some functions to subs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsparkes committed Aug 21, 2022
1 parent a915752 commit b07f7b2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions AIFunctions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ Module AIFunctions
#End If
End Function

Public Function save_game() As Object
Public Sub save_game()
#If VERBOSE Then
Call Main_Renamed.append_simple("In save_game() writing to \save.txt ++++++")
#End If
Expand All @@ -462,7 +462,7 @@ Module AIFunctions
Next i

FileClose(1)
End Function
End Sub

Public Function load_game() As Object
#If VERBOSE Then
Expand Down
24 changes: 12 additions & 12 deletions Functions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -188,27 +188,27 @@ Module ArrayFunctions
Next i
End Sub

Public Function copy_array(ByRef arr_from As Object, ByRef arr_to As Object) As Object
Public Sub copy_array(ByRef arr_from As Object, ByRef arr_to As Object)
Dim i As Short
'UPGRADE_WARNING: Couldn't resolve default property of object size(arr_from). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For i = 0 To size(arr_from)
'UPGRADE_WARNING: Couldn't resolve default property of object arr_from(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object arr_to(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
arr_to(i) = arr_from(i)
Next i
End Function
End Sub

Public Function copy_array2(ByRef arr_from As Object, ByRef arr_to As Object, ByVal index As Short) As Object
Public Sub copy_array2(ByRef arr_from As Object, ByRef arr_to As Object, ByVal index As Short)
Dim i As Integer
'UPGRADE_WARNING: Couldn't resolve default property of object size2(arr_from, index). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For i = 0 To size2(arr_from, index)
'UPGRADE_WARNING: Couldn't resolve default property of object arr_from(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object arr_to(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
arr_to(index, i) = arr_from(index, i)
Next i
End Function
End Sub

Public Function copy_array3(ByRef arr_from As Object, ByRef arr_to As Object, ByVal index1 As Short, ByVal index2 As Short) As Object
Public Sub copy_array3(ByRef arr_from As Object, ByRef arr_to As Object, ByVal index1 As Short, ByVal index2 As Short)
Dim i As Integer
' Not used Dim j As Short
'UPGRADE_WARNING: Couldn't resolve default property of object size3(arr_from, index1, index2). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Expand All @@ -217,7 +217,7 @@ Module ArrayFunctions
'UPGRADE_WARNING: Couldn't resolve default property of object arr_to(). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
arr_to(index1, index2, i) = arr_from(index1, index2, i)
Next i
End Function
End Sub

Public Function size(ByRef arr As Object) As Object
Dim i As Short
Expand Down Expand Up @@ -260,7 +260,7 @@ Module ArrayFunctions
size3 = i
End Function

Public Function sort(ByRef arr As Object) As Object
Public Sub sort(ByRef arr As Object)
' Dim k, i, j, temp As Object
Dim k, i, j, temp, v As Short
'UPGRADE_WARNING: Couldn't resolve default property of object size(arr). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Expand All @@ -281,9 +281,9 @@ Module ArrayFunctions
End If
Next j
Next i
End Function
End Sub

Public Function rsort(ByRef arr As Object) As Object
Public Sub rsort(ByRef arr As Object)
' Dim k, i, j, temp As Object
Dim k, i, j, temp, value As Short
'UPGRADE_WARNING: Couldn't resolve default property of object size(arr). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Expand All @@ -304,7 +304,7 @@ Module ArrayFunctions
End If
Next j
Next i
End Function
End Sub

Public Sub sort2(ByRef arr As Object, ByVal index As Short)
Dim temp_arr(500) As Object
Expand All @@ -320,7 +320,7 @@ Module ArrayFunctions
Call rebuild(arr, index, temp_arr)
End Sub

Public Function randomize_array(ByRef arr As Object) As Object
Public Sub randomize_array(ByRef arr As Object)
Dim new_array(500) As Object
Dim picked(500) As Object
Randomize()
Expand Down Expand Up @@ -353,7 +353,7 @@ Module ArrayFunctions
Call print_array(new_array, "Shuffled")
#End If
'Call print_array(new_array, "Shuffled")
End Function
End Sub

Public Sub randomize_array2(ByRef arr As Object, ByVal index As Short)
Dim temp_arr(500) As Object
Expand Down
17 changes: 9 additions & 8 deletions main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ Friend Class Main_Renamed
' Read the debug file and update the board state accordingly
'UPGRADE_NOTE: str was upgraded to str_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
Dim filename As Object
Dim str_Renamed As String
Dim str_Renamed = ""
#If VERBOSE Then
Call append_simple("In launch_game() ++++++ Read the debug file and update the board state accordingly /testing.txt")
#End If
Expand Down Expand Up @@ -1620,8 +1620,10 @@ Friend Class Main_Renamed

Private Sub exchange_canal_building(ByVal player As Short)
Dim temp(40) As Object
Dim count, high_in_hand As Object
Dim count As Object
Dim high_in_hand = -1
Dim high_in_score, i As Short

'UPGRADE_WARNING: Couldn't resolve default property of object dogma_copied. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
If active_player <> player Then dogma_copied = 1

Expand Down Expand Up @@ -1770,7 +1772,6 @@ Friend Class Main_Renamed
'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Age 1
'''''''''''''''''''''''''''''''''''''''''''''''''''''
'''
#If VERBOSE Then
Call append(player, "In activate_card() AGE 1")
#End If
Expand Down Expand Up @@ -5735,7 +5736,7 @@ Friend Class Main_Renamed


Private Sub end_game_10(ByRef player As Object)
If winner_found Then Exit Sub
If winner_found() Then Exit Sub

Dim min As Object
Dim i, winner_count As Short
Expand Down Expand Up @@ -5780,7 +5781,7 @@ Friend Class Main_Renamed
End Sub

Private Sub end_game_points()
If winner_found Then Exit Sub
If winner_found() Then Exit Sub

Dim i As Short
For i = 0 To num_players - 1
Expand All @@ -5796,7 +5797,7 @@ Friend Class Main_Renamed

'UPGRADE_NOTE: str was upgraded to str_Renamed. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
Private Sub end_game_generic(ByVal player As Short, ByVal str_Renamed As String)
If winner_found Then Exit Sub
If winner_found() Then Exit Sub

winners(player) = 1
If ai_mode = 0 Then
Expand All @@ -5806,11 +5807,11 @@ Friend Class Main_Renamed
End Sub

Private Sub end_game_ai()
If winner_found Then Exit Sub
If winner_found() Then Exit Sub

Dim min As Object
Dim i, winner_count As Short
Dim winner_str As String
Dim winner_str As String = ""
winner_count = 0
'UPGRADE_WARNING: Couldn't resolve default property of object scores(0). Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
'UPGRADE_WARNING: Couldn't resolve default property of object min. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Expand Down

0 comments on commit b07f7b2

Please sign in to comment.