I have a question about creating a subroutine, which means it doesn’t have any return value. Like a subroutin just write certain data into serial port or clear serval gloable properties to their inital value, etc.
What’s the best way to do that? I use methods a lot, but that require a return value. in the VB, I can use something like,
Sub doSomething(ByVal i as Integer, ByRef j as Single)
' blocks of code
End sub
Then, call it in an button.click event or anywhere I want,
Just leave the return value blank in the inspector. In fact, you can select an item (window/class/module) in the Xojo navigator (make sure it is blue not gray) and paste your sub dosomething etc… and a new method will be inserted.
FWIW in the spirit of examples if you do happen to create a function (method that returns a value) and say you wanted to call if bypassing the return value you can do: