Structure field name confuse variable name
Posted: Wed Sep 07, 2022 8:55 pm
I am trying to program a packman version for study class.
When i use a variable called Direction en i use a structure e.g. Pinky()'\Direction. the Pinky()\Direction is seen as a variable Direction.
Code example
Two differend variables but only the global created variable is reconized.
When i use a variable called Direction en i use a structure e.g. Pinky()'\Direction. the Pinky()\Direction is seen as a variable Direction.
Code example
Code: Select all
#Left =1
#Right = 2
Global Direction.i = 0
Structure Pink
Direction.i
Endstructure
Global NewList Pinky.Pink()
Addelement (Pinky())
pinky()\Direction = #Left
Debug Pinky()\Direction ;Result in 0
debug Direction ;Result in 0