Is there a way to sort nodes by code ?
There is Swap routine for the node child’s. So you could pretty easily implement sort routine for it, based on your needs.
I have implemented Sort for next version to simplify this.
You will though need to provide Node comparison routine for it.
It might be out in a day or two, though only on the Xojo Beta list for now since it has features also for the Xojo beta. (so if your not there then you might want to sign up for their beta program)