11-10-2023, 01:30 AM
(This post was last modified: 11-10-2023, 01:31 AM by James D Jarvis.)
I'm surely missing something somewhere but why aren't the subroutines working on the values in this user defined type?
Shouldn't incr be increasing the values as it does for the variable A?
Shouldn't incr be increasing the values as it does for the variable A?
Code: (Select All)
Type score_type
max As Integer
cur As Integer
End Type
Type player_type
power As score_type
speed As score_type
x As Integer
y As Integer
End Type
Dim player As player_type
player.power.max = 100
player.power.cur = 0
player.x = 100
player.y = 100
A = 10
incr A, 1
Print A
incr player.power.cur, 1
Print player.power.cur
incr player.x, 1
Print player.x
Sub incr (n, v)
n = n + v
End Sub
Sub decr (n, v)
n = n - v
End Sub