How to access variables from another class, and change them?

How could I use the above to reference to this example:

MainDevice := class(creative_device):

@editable NewFoo : Foo = Foo{}

Foo := class(MainDevice):

@editable var FooInt : int = 0

The @editable part in the “MainDevice” seems to not work at all unless I use an array of type Foo. Any idea how to fix this? Also if you noticed, Foo inherits from MainDevice.