views:

193

answers:

1

Just started coding in AS3 with FlashDevelop and coming from a C# background, I would like to know if there's something equivalent to the #region directive in AS3?

The #region directive in C# essentially allows an IDE e.g Visual Studio to collapse or expand a section of code to improve readability. With #region directives, you can split codes in sections e.g constructors, properties, public/private methods to aid others perusing your code.

So the C# code below ...

interface IPurchaseOrder
{
    #region Properties

    bool IsProcessed { get; set; }
    bool ISValidOrder { get; set; }

    #endregion Properties

    #region Methods

    bool ProcessOrder();

    #endregion Methods
}

becomes

interface IPurchaseOrder
{
    Properties

    Methods
}
+2  A: 

With flashdevelop it works like this:

//{ region region name

  ...your code here

//} endregion 
Smalcat
I take it that the expand/collapse region functionality is a FlashDevelop-specific feature?
Mr Roys
Yes of course. Code hidding is always IDE/texteditor specific.
Smalcat