Jump to content

TIDY - #region #endregion - automatic renaming


Go to solution Solved by Jos,

Recommended Posts

Posted (edited)

I suspect that not everywhere shut the # region using # endregion
So I wanted to check it out with TIDY (or so I thought so check)

So I made a small little script
 

#region 1
#region 2
#region 3
#region 4
#endregion
#endregion
#endregion

and run TIDY

the effect was that

 

#region 1
#region 2
#region 3
#region 4
#endregion 4
#endregion 3
#endregion 2

basically correct, taking into account that I forgot about the closure of the clause EDIT: Directive #region 1

a console show that somethig

 

  Quote

 

>"C:Program Files (x86)AutoIt3SciTEtidytidy.exe" "J:TOOLsMacroWORK    KK_Weryfikator_Sprawtest region.au3"
Tidy AutoIt3 v2.3.0.8   Copyright © Jos van der Zande  March 24, 2013
+> Tidy AutoIt3 finished and has no updates to make!
>Exit code: 0    Time: 0.053

 

and, in principle, it is also theoretically OK
but I wonder if it could be better

and TIDY maybe? could in the future? do something like that message in a console
"invalid number #region compared to #endregion"

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

  • Moderators
Posted

mlipok,

When I run that script I get:

#region 1
    #region 2
        #region 3
            #region 4
            #endregion 4
        #endregion 3
    #endregion 2

;### Tidy Error -> #region is never closed in your script.
with the console reading:

>"M:\Program\AutoIt3\SciTE\tidy\tidy.exe" "M:\Program\Au3 Scripts\fred4.au3" 
Tidy AutoIt3 v2.3.0.11 Copyright (c) Jos van der Zande July 22, 2013 
"M:\Program\Au3 Scripts\fred4.au3"(1) : ### Tidy Error -> "#region" is never closed in your script. 
!> there were 1 error(s) encountered. look in your source for:### Tidy Error: 
+> Tidy AutoIt3 finished. Original copied to:"M:\Program\Au3 Scripts\Tidy BackUp\fred4_old1.au3" 
>Exit code: 1 Time: 1.530
which is entirely what I expected. :)

Perhaps you need to update your Tidy version - I see you are a couple of updates behind. ;)

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

Well basically in this case is exactly as claim

but more specifically it's not the end

I'm at work
I'm working on-site at the customer's
I do not use AutoIt Portable
just at this point I have the current version of the latest version of SciTEAu ...
and not the beta version

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

I was just wondering
that the components TIDY AU3CHECK AUTOITWRAPER
can be used in the new version, assuming that I'm using AU3.3.8.1

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 (edited)

:blink: The packages are not updated for all the new versions of its components.

To download the latest Tidy version, go here.

Edited by FireFox
Posted

Thanks @FireFox

but I dont ask where I can find that tools

but do I can safely use this new tools with Au3.3.8.1 and latest version SciTE4AutoIt3

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

  • Moderators
Posted

mlipok,

Yes, you can use the newer versions of Tidy and AU3Check with the current release versions of AutoIt and SciTE4AutoIt3. :)

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

 

  • Developers
  • Solution
Posted (edited)

The #Region error is only shown when you have the /region_indent parameter.

I will have a look that it is always shown.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

@Jos

thanks for attention

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

ps.

see that

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

  • Developers
Posted

The reason that you only got the Error when /region_indent is used is that this is then part of the Indentation logic which checks for proper start and end of an Indentation.

I have now added some checks at the end of the Tidy process which will report on none closed #region statements and report those.

It will now also report an Warning when you have a #EndRegion without an opening #Region statement,

Give the current Beta version a try.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Developers
Posted
  On 8/3/2013 at 3:57 PM, mlipok said:

ps.

see that

No sure why you ask me to look at this link. This isn't a utility I support.

All official updates are done with the installer and I regularly make Beta version available of the different utilities I support but will not do any automated notification for upgrade for those as they often have some prerequisite to take into account.

Jos :)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

  • Moderators
Posted

Jos,

Works fine for me. :)

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
  On 8/3/2013 at 4:34 PM, Jos said:

No sure why you ask me to look at this link. This isn't a utility I support.

 

my mistake

this was not to You

but to all reading this post

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

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...