Creating blocks of code that expand or retract

Hello there,

My guess is that his question has already been asked, but couldn’t find it in the forum.

The code editor provides a way to contract or expand block of codes for if, for etc, clicking on + or -. This is automatically managed. I was wondering if one can create a custom block of code with that feature, that would expand or contract. For example in .Net you can do this with #region and #end region, or something similar. Can this be done in Xojo ?

Thanks

#If True // My block
  
  
#EndIf
3 Likes

And if you want the variables within to be scoped, use a regular If.

Interesting way to implement the solution to my question ! Thanks @Rick_Araujo !

1 Like