Hi Folks - I realize this is a very fundamental question about class management in Xojo, but I missed the boat somewhere, and the boat has changed over the years.
I want to instantiate SerialConnection in the App class. This seems to be a sensible thing to do since the SerialConnection is going to be used by several windows, but only one window at a time. If I have multiple copies, then signal routing becomes convoluted.
So, the first thing I tried is this simple statement in the opening event of App:
var USBSerial as new SerialConnection
But then the compiler says Type “App” has no member named “USBSerial” .
So, I add a property USBSerial as SerialConnecton to App. The compiler no longer complains but when running code reaches a line App.USBSerial.Device = SerialDevice.At(i), it throws a “nil object exception” (SerialDevice.At(i) appears to be valid, not nil),
I have read through the tutorial about classes and I have no clue what to do. Help would be appreciated.
Thanks
Jim, Oregon Research Electronics
3 posts - 3 participants