Jump to content

Recommended Posts

Posted (edited)

REPRO:

Func _test()
    $sdlugosc = ''
    $sDlugosc = 1 ; here ;  Why after using TIDY the UPPER leter D is changed to LOWER letter D
EndFunc   ;==>_test

HOW TO:

Try to use Tidy in SciTE

Watch on big letter "D"

 

QUESTION: Why after using TIDY the UPPER leter D is changed to LOWER letter D ?

 

Attachment: my test file

 

EDIT: typo

TEST_TIDY_lowercase_issue.au3

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

Tidy will normalize all variables to mirror the case of first time the variable is seen in the script or the time it is declared using Global, Local or Dim by default.

  Quote

 

* * *  Update Variables to: 1=LowerCase; 2=UpperCase; 3=First Dim/Local/Global or "First_Seen" Case

vars=3

From the Tidy.ini example file.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

I think because you frist declared it with lower case D. I think tidy modifies all the variables to that way which you declared first. This way the same variables won't appear different ways and it will remain the same all the time :)

Posted

I thought so too.
But I have yet another strange case.
For now, I can not fully identify him.

I'm working on it.

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)

ok
so I do a test and now I see where is the issue

Func _Func()
    Local $sUpper_1 = ''
    Local $sUpper_2
    $supper_1 = 1
    $supper_2 = 2 ; here does not change to Upper
    Local $slower_1 = ''
    Local $slower_2  ; any comment
    $sLower_1 = 1
    $sLower_2 = 2 ; here does not change to lower
EndFunc   ;==>_Func

EDIT:

its only happen when declaration Local Global is not setting any value.

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

Seems as if the variable isn't initialized when declared it's not being seen correctly by Tidy.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

  Reveal hidden contents

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

so we must wait for Jos opinion.

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

  On 5/2/2014 at 7:10 PM, mLipok said:

so we must wait for Jos opinion.

This is a regression bug in tidy started when I build in support for the new Function notation.

Uploaded Tidy v2.4.0.2 to Beta which should fix this.

Thanks

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

Thanks Jos

I confirm as fixed.

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

sorry
not at all...
 

Func _Func()
    Local $sUpper_1 = ''
    Local $sUpper_2
    $supper_1 = 1
    $supper_2 = 2 ; here now changeing to Upper
    Local $slower_1 = ''
    Local $slower_2  ; any comment
    $sLower_1 = 1
    $sLower_2 = 2 ; here now changeing to lower
EndFunc   ;==>_Func


Func _test()
    $sLength = ''
    $slength = 1 ; here not changeing to Upper
    $swidth = ''
    $sWidth = 1 ; here not changeing to lower
EndFunc   ;==>_test

like you see above the last option (described below) is not supported correctly:

  On 5/2/2014 at 4:10 PM, Jos said:

The default for the way the Variables are Tidied is either by the first DIM/GLOBAL/LOCAL definition or else its first occurrence.

Jos

 

EDIT: typo

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

Thanks @Jos

I confirm as completely fixed :)

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

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
×
×
  • Create New...