odaylton

Tidy error After using the first 15 lines are replaced

3 posts in this topic

Text translated from Portuguese by google - please apologize for any errors
After using the first 15 lines are replaced
I'm using autoitdebug and made the new update installation of v3.3.14.2 autoit
And Tidy AutoIt3 v2.3.0.8 Copyright (c) Jos van der Zande March 24, 2013
After using it incere 15 lines containing:

e|_WinNet_GetUser|_WinNet_OpenEnum|_WinNet_RestoreConnection|_WinNet_UseConnection|_Word_Create|_Word_DocAdd|_Word_DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
num|_WinNet_RestoreConnection|_WinNet_UseConnection|_Word_Create|_Word_DocAdd|_Word_DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
DocAttach|_Word_DocClose|_Word_DocExport|_Word_DocFind|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
d|_Word_DocFindReplace|_Word_DocGet|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
Get|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
t|_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
_Word_DocLinkAdd|_Word_DocLinkGet|_Word_DocOpen|_Word_DocPictureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
ureAdd|_Word_DocPrint|_Word_DocRangeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|
angeSet|_Word_DocSave|_Word_DocSaveAs|_Word_DocTableRead|_Word_DocTableWrite|_Word_Quit|

 

Replacing my script

What went wrong
 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

40 minutes ago, odaylton said:

Tidy AutoIt3 v2.3.0.8 Copyright (c) Jos van der Zande March 24, 2013

I would need the source you use to replicate your issue, but first update to the latest version of SciTE4AutoIt3 since this version is more than 3 years old!

Jos

PS: not need to PM me with a link unless I haven't responded with a couple of days. ;)

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Okay, it was only update that solved the problem ... Sorry for the silly.
I do not know why it was such an old version ...
Another topic:
Really tidy is wonderful but I have a small suggestion for an improvement.
Create programs since 1985 for personal use and recently (2010) adopted by the Autoit meet as my way of thinking
With my experience I created certain documentation habits for my development.
Mainly because of resuming old projects months after starting.
So the reading programs should be something easier.
For example:

MsgBox(Default,"Impossivel Continuar",  "Favor incerir um titulo" & @CRLF & "Quarquer duvida entrar em contato" & @CRLF & $Contato, 15, Default)

I could stay so for readability.

MsgBox( Default, _      ; flag
        "Impossivel Continuar", _ ;"title"
        "Favor incerir um titulo" & @CRLF & _
        "Quarquer duvida entrar em contato" & @CRLF & _
        $Contato, _     ; "text"
        15, _           ;[, timeout
        Default)        ;[, hwnd]])

Note that in all "," I add, "_; function argument's comment "+ [line break] (obtained by help texts)
Also note that every "& @CRLF &" I would add "& @CRLF & _" + [line break]
I wonder what you think and if there is an easy way to change the tidy so you can at least adjust here and make it more practical for me
Another suggestion is that when the tidy is a new function with its arguments would appear a dialog window asking for comments for each field.
thus generating the UDF documentation
Examples:

Global $NomeProjeto = "", _     ;nome da pasta
        $DirProjeto = "", _     ;path da pasta
        $PastaProjeto = "", _   ;caminho sem o drive (usado em _PathMake)
        $DriveProjeto           ;letra do drive da pasta(usado em _PathMake)

Global $JanelaAtiva[10] ;Dados da janela ativa atual
;[0] Handle
;[1] PID    Processo ID
;[3] Path
;[4] Titulo
;[5] file name process
;[6] XCentro
;[7] yCentro
;[8] ContolID
;[8] ClassControl
;[9] InnstanceControl
ToolTip(    "Digitando[" & $Testo & "]" & @CRLF & _
            "Aguarde os testes...", _   ; Testo
            Default, Default, _         ; coordenadas do mouse
            "Testando o Campo", _       ; Titulo do Tip
            2, _                        ; Icone
            5)                          ;1+4 Baloon e sempre Visível

In the case of UDF
Ex

; #INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __ArrayDualPivotSort
; Description ...: Helper function for sorting 1D arrays
; Syntax.........: __ArrayDualPivotSort ( ByRef $aArray, $iPivot_Left, $iPivot_Right [, $bLeftMost = True ] )
; Parameters ....: $aArray  - Array to sort
;                  $iPivot_Left  - Index of the array to start sorting at
;                  $iPivot_Right - Index of the array to stop sorting at
;                  $bLeftMost    - Indicates if this part is the leftmost in the range
; Return values .: None
; Author ........: Erik Pilsits
; Modified.......: Melba23
; Remarks .......: For Internal Use Only
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================
Func __ArrayDualPivotSort(ByRef $aArray, $iPivot_Left, $iPivot_Right, $bLeftMost = True)


I would do the following:

Func __ArrayDualPivotSort(  ByRef $aArray, _    ; Array to sort 
                            $iPivot_Left, _     ; Index of the array to start sorting at
                            $iPivot_Right, _    ; Index of the array to stop sorting at
                            $bLeftMost = True)  ; Indicates if this part is the leftmost in the range
;#INTERNAL_USE_ONLY# ===========================================================================================================
; Name...........: __ArrayDualPivotSort
; Description ...: Helper function for sorting 1D arrays
; Return values .: None
; Author ........: Erik Pilsits
; Modified.......: Melba23
; Remarks .......: For Internal Use Only
; Related .......:
; Link ..........:
; Example .......:
; ===============================================================================================================================


I hope this idea will inspire you to this new challenge.
Thanks for listening
 

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • Jos
      March 11, 2016: New SciTE4AutoIt3 available with the updated SciTE v3.6.2 release.
      By Jos
      11-3-2016: Uploaded a new SciTE4AutoIt3.exe.
      Merged the SciTE 3.6.2 source into our version and several other changes and fixes to the supporting utilities.
      Enjoy,
      Jos
      Addition/Changes/Fixes in the current installer:
      -------------------------------------------------------------------------------------------------- 6-3-2016 *** Merged the SciTE v 3.6.2 by Neil Hodgson with our own version of SciTE. (Jos) *** Updated AutoIt3Wrapper v16.306.1237.0 (Jos) - 15.920.938.2 removed the check for utf8 for au3check as that is supported - 15.920.938.3 Reverted __ConsoleWrite() to ConsoleWrite for ShowStdOutErr() - 15.920.938.4 added info for codepage and utf8 check to header. - 15.920.938.5 Only warn about #RequireAdmin for Run option. - 15.920.938.6 fixed issue when these were used together: #AutoIt3Wrapper_Run_Au3Stripper=y #AutoIt3Wrapper_Res_SaveSource=Y - 15.920.938.8 Modifications from DickG for the GUI Control locations and sizes to fit other screen sizes. *** Updated Au3Stripper v16.306.1237.0 (Jos) - 15.920.938.2 Fixed error line number for statements using unresolved func name Added logic to remove the () behind the Func in case of this type of lines: Call(Example3(), 'fff') NewFoundWord$ is then="Example3()" - 15.920.938.3 Added minus sign support to preexpand variables. - 15.920.938.4 Fixed crash in the get firstword logic to limit the returned length to 500. - 15.920.938.5 Fixed /PE replacing the variable in a For $x= statement. *** Updated SciTEConfig v16.306.1237.0 (Jos) - 15.920.938.1 hide/unhide when opening Tidy.ini to avoid a hidden msgbox hanging SciTEConfig.au3 - 15.920.938.2 Added the creation of includes.txt for AutoComplete Standard UDFs when "#include" is typed. - 15.920.938.3 Fixed for CallTip not always updating correctly. *** Updated Tidy v16.306.1237.0 (Jos) - 15.920.938.1 Fixed issue with space removal between [ and Then - 15.920.938.2 #forceref and #forcedef now also tidied. - 15.920.938.3 Enfoces a single space between end-of-line and inline comment - 15.920.938.4 Fixed regression extra space between EndFunc and #EndRegion and the added comments. --------------------------------------------------------------------------------------------------   ==> ScitillaHistory page containing all SciTE-Scintilla updates.
      ==> Visit the SciTE4AutoIt3 Download page for the latest versions
      ==> Check the newly formatted the online documentation for an overview of all extra's you get with this installer.
    • darthwhatever
      Tidy erases whitespace on If-ElseIf lines with paranthesis inside brackets
      By darthwhatever
      I believe I have found a bug in the latest version of Tidy, which I have downloaded from the Scite4Autoit website. Tidying the following code 
      If $a[1 - function('')] Then ElseIf $a[fucntion()] Then ElseIf $a[(0)] Then ElseIf $a[function() - 0] Then ElseIf $a[function(0)] = 1 Then EndIf will erase the whitespace between the closing brackets and the then keyword whenever the last expression is a function. This also occurs on ElseIf lines, and results in this code: 
      If $a[1 - function('')]Then ElseIf $a[function()]Then ElseIf $a[(0)]Then ElseIf $a[function() - 0] Then ElseIf $a[function(0)] = 1 Then EndIf Which does not run. Should I submit a bug report on the autoit bugtracker? For now I can either use the #Tidy_on and #Tidy_off directives to skip these lines so that the source actually runs. 
    • nitekram
      Tidy Change/Update Function Info?
      By nitekram
      How would I go about adding the following to every function, after calling Tidy? Is it a hard process?
      I would want it to fill in:
      Name of the function Parameters Variable Names from the function, and put them in place - adding more parameter spaces as needed Fill in the created date ; #FUNCTION# ==================================================================================================================== ; Name ..........: $NameOfFunction ; Description ...: ; Syntax ........: ; Parameters ....: $Param_1 ; $Param_2 ; $Param_3 ; Return values .: ; Author ........: ; Created .......: ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== ; Also, was wondering, how hard it would be to create another tool, as I seem to always want to see the values being sent to a function, maybe a HotKey (script) that can put a
      MessageBox box/ConsoleWrite at the top off all the functions (or at least the one high lighted? With the name of the function as title, and each parameter/variable in the header, put its name and value on separate lines.
       
      EDIT
      Or the syntax of a UDF - do not remember where that is, but will see if I can find it.
       
      EDIT 2
      Found this, I assume it should be added, so when I find it, I guess I will
      https://www.autoitscript.com/wiki/Best_coding_practices
       
    • mLipok
      TIDY - /sort_funcs - Long function names
      By mLipok
      Is there any limit in function name length for TIDY ?
      I want to sort functions in this UDF {attachment removed - quota cleanup}
      And I see that function named:
      _QPDF_Example_Commercial_1.....
      _QPDF_Example_Commercial_2.....
      _QPDF_Example_Commercial_3.....
      ....
      are not sorted correctly.
      mLipok
    • VenusProject2
      Tidy.exe
      By VenusProject2
      Is it possible to pass the path e.g. "c:\mypath\myscript.au3" to tidy.exe via the cmd line instead of using the OpenDialogue window? Sorry I couldn't find any reference to this in the help files
      Run("C:\Program Files (x86)\AutoIt3\SciTE\Tidy\tidy.exe /gen_doc")