Add struct field access
This commit is contained in:
17
tests/struct.grnd
Normal file
17
tests/struct.grnd
Normal file
@@ -0,0 +1,17 @@
|
||||
struct -point
|
||||
|
||||
init &x -int
|
||||
init &y -int
|
||||
|
||||
endstruct
|
||||
|
||||
init &mypoint -point
|
||||
|
||||
setfield &mypoint &x 53
|
||||
setfield &mypoint &y 32
|
||||
|
||||
getfield $mypoint &x &value
|
||||
println $value
|
||||
|
||||
getfield $mypoint &y &value
|
||||
println $value
|
||||
Reference in New Issue
Block a user