Jump to content

How to group blocks of code and add a collapsible drop down like on some example scripts?


Recommended Posts

Posted

I see that some scripts have a little + sign that you can click to drop down.

This makes the script smaller and easier to manage, is this only for IF commands?

How can I use that technique on any line to group sub lines together that can be toggled on or off?

drop-down-auto-it.png

  • Moderators
Posted

xuzo,

Use the #region / #endregion directives.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)
  On 10/31/2015 at 11:05 AM, xuzo said:

is this only for IF commands?

Not only, also for any other Start/Stop "Statement",  like

Func <> EndFunc

With <> Wend

Select .. Switch.... For .... While ... Do ....

btw.

You can also use #region like this:

#Region - Some Description
Send("This is line text 1")
Send("This is line text 2")
#EndRegion - Some Description

 

EDIT: also comment block can be folded.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@xuzo try also to look here:

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...