Is it OK to change this:
Type myudt
lweapon(1 to 10) As Long
sweapon(1 to 20) As Long
End Type
Global tt As myudt
Dim i As Long
For i = 1 to 20
tt.sweapon(i) = tt.sweapon(i) + 1
Next i
To This:
Type myudt
lweaponS As String * 40
sweaponS As String * 80
End Type
Global tt As myudt
And then access the data like this:
Dim vPTR As Long PTR
Dim i As Long
vPTR = VARPTR(tt.sweaponS)
For i = 1 To 20
@vPTR[i - 1] = @vPTR[i - 1] + 1
Next i
Did I break any written or unwritten power basic programming rules?
My program that I am doing this in runs great, I am unable to detect
any errors. I have just never used pointers like that before, it looks
a little wierd, is it OK?
Tim Wisseman
[email protected]
[This message has been edited by Tim Wisseman (edited January 08, 2000).]
Type myudt
lweapon(1 to 10) As Long
sweapon(1 to 20) As Long
End Type
Global tt As myudt
Dim i As Long
For i = 1 to 20
tt.sweapon(i) = tt.sweapon(i) + 1
Next i
To This:
Type myudt
lweaponS As String * 40
sweaponS As String * 80
End Type
Global tt As myudt
And then access the data like this:
Dim vPTR As Long PTR
Dim i As Long
vPTR = VARPTR(tt.sweaponS)
For i = 1 To 20
@vPTR[i - 1] = @vPTR[i - 1] + 1
Next i
Did I break any written or unwritten power basic programming rules?
My program that I am doing this in runs great, I am unable to detect
any errors. I have just never used pointers like that before, it looks
a little wierd, is it OK?
Tim Wisseman
[email protected]
[This message has been edited by Tim Wisseman (edited January 08, 2000).]
Comment