The structure of maxscript is painful


#1
struct testDef
(
	info = "no info",

	fn addInfo txt =
	(
		append this.info txt
	)
)


fn getInfo =
(
	t = testDef()
	t.addInfo "add some info contnet."
	
	t2 = testDef()
	t2.info
)
getInfo()
getInfo()
getInfo()

The right result

#Struct:testDef(
  addInfo:<fn>; Public,
  info:<data>; Public)
getInfo()
"no info"
"no info"
"no info"

max 2022:

#Struct:testDef(
  addInfo:<fn>; Public,
  info:<data>; Public)
getInfo()
"add some info contnet."
"add some info contnet.add some info contnet."
"add some info contnet.add some info contnet.add some info contnet."

#2

Max 2022 is not working correctly … this is a bug and needs to be fixed. My guess is that in MAX 2022 #this now means not an instance of a structure, but its definition. It is wrong and cannot be accepted in this way.


#3

Please post this example on AREA