Jump to content

Beta of New AutoIt3 Tidy


Jos
 Share

Recommended Posts

  • Developers

I have rewritten Tidy as Console Application by manually converting the AutoIt3 script to BCX/Pelles_C.

This Tidy version is, depending on the size and complexity of the script, up to 50 times faster.

Some test results on a Pentium M 1.60 GHz:
    Script Lines   Old_Tidy  New_Tidy
      400           4 seconds  0.7 second
     1400          22 seconds  1.0 second
     9800         170 seconds  3.6 seconds
    17680         310 seconds  6.6 seconds

The Tidy default options are located in Tidy.Ini and can also be set via Commandline or Directive parameters. Tidy will read the #Tidy_Parameters directive and use it to set/override options.

see helpfile for details.

The attached ZIPfile contain the Tidy2 RC1 version and the draft Helpfile page.

Requesting some feedback from you all to ensure it is working properly before releasing it with the next SciTE4AutoIt3 installer !

To install this version :

1. Save your current Tidy.exe and Tidy.ini.

2. Download the attached Zip file and copy the Tidy.exe and Tidy.ini to the Tidy program directory.

3. Update au3.properties Tidy setting with the following lines:

# 09 JdeB's Tidy formatting program for Autoit3 
command.9.$(file.patterns.au3)="$(SciteDefaultHome)\tidy\tidy.exe" "$(FilePath)"
command.name.9.$(file.patterns.au3)=Tidy AutoIt Source
command.subsystem.9.$(file.patterns.au3)=0
command.save.before.9.$(file.patterns.au3)=1
command.shortcut.9.$(file.patterns.au3)=Ctrl+T
command.is.filter.9.$(file.patterns.au3)=1

4. Make sure you have au3.api in the Tidy directory. Should be when you have kept up-to-date.

EDIT: Tidy 2.0 RC2

- Fixed the generated doc file Func and Variable Xref report (Tnx Mhz)

- Fixed spacing between ( and "string"

EDIT: Released with SciTE4AutoIt3..

Enjoy,

:whistle:

Edited by JdeB

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

Link to comment
Share on other sites

  • Moderators

Tidy AutoIt3 v2.0 RC1 Copyright © Jos van der Zande August 12, 2006

+> Tidy AutoIt3 finished. Original copied to:"C:\Documents and Settings\Admin\Desktop\BackUp\_EnCodeIt-V1.03_old1.au3"

>Exit code: 0 Time: 0.632

That's super fast...

But... It's late, and it's probably my fault... any reason why my winmerge popped up on me that you can think of?

Edit:

That was 1100 lines btw.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

... any reason why my winmerge popped up on me that you can think of?

Sure, its an extra feature to show the difference between the original and the Tidy-ed version. Mainly created for my own testing to see if the program works correct :whistle:

Just change the below line in Tidy.ini :

*** Run DIFF program at the end of the Tidy run to show the difference between original and new program.

ShowDiffPgm=C:\Progra~1\WinMerge\winmerge.exe "%new%" "%old%"

to

*** Run DIFF program at the end of the Tidy run to show the difference between original and new program.

xShowDiffPgm=C:\Progra~1\WinMerge\winmerge.exe "%new%" "%old%"

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

Link to comment
Share on other sites

Tested on 4000 lines, It was so fast I couldn't time it.

I noticed it doesn't prompt you anymore.

>"C:\Program Files\AutoIt3\SciTE\tidy\tidy.exe" "H:\Sleeve Testing Scripts\Manager Scripts\MC_GUI_With_Client.au3"
Tidy AutoIt3 v2.0 RC1   Copyright (c) Jos van der Zande  August 12, 2006
+> Tidy AutoIt3 finished. Original copied to:"H:\Sleeve Testing Scripts\Manager Scripts\BackUp\MC_GUI_With_Client_old1.au3"
The system cannot find the path specified.
>Exit code: 0   Time: 1.594

RK

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

  • Developers

Tested on 4000 lines, It was so fast I couldn't time it.

I noticed it doesn't prompt you anymore.

I have rewritten Tidy as Console Application by manually converting the AutoIt3 script to BCX/Pelles_C....

Yeap... its a console app now ... don't know about you but i never change the settings, but if you want you can just use the #Tidy_Parameters directive somewhere at the top of your script..

:whistle:

Edited by JdeB

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

Link to comment
Share on other sites

Yeap... its a console app now ... don't know about you but i never change the settings, but if you want you can just use the #Tidy_Parameters directive somewhere at the top of your script..

:whistle:

i c,

Was "Replace.." under search in SciTE modified too?

As I remmeber it was very slow, now its fast (Maybe becuase I switched PCs).

Thanks for your hard work,

RK

"When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix

Link to comment
Share on other sites

This is really fast!! I like it a lot.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

  • Developers

Attached a new version:Tidy 2.0 RC2 (First post)

- Fixed the generated doc file Func and Variable Xref report (Tnx Mhz)

- Fixed spacing between ( and "string"

Let me know when other bug are found ...

:whistle:

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

Link to comment
Share on other sites

  • 2 weeks later...

I have rewritten Tidy as Console Application by manually converting the AutoIt3 script to BCX/Pelles_C.

This Tidy version is, depending on the size and complexity of the script, up to 50 times faster.

Yes, thank you very much for this hint!

I think, BCX together with the AutoItX3.dll is a very good addition to AutoIt, when execution speed is an issue.

But the pre-configured Editors I found are far away from the very good SciTE4AutoIt. :nuke:

May I ask, what editor do you use for BCX? (Or do you have already adjusted SciTE for BCX? :P )

And what about the new Tidy source code (BCX-Basic)? Would you like to publish your code?

(OK, i hope the BCX subject isn't too off-topic here.) :)

Thanks!

Link to comment
Share on other sites

  • Developers

Yes, thank you very much for this hint!

I think, BCX together with the AutoItX3.dll is a very good addition to AutoIt, when execution speed is an issue.

But the pre-configured Editors I found are far away from the very good SciTE4AutoIt. :nuke:

May I ask, what editor do you use for BCX? (Or do you have already adjusted SciTE for BCX? :P )

This is the way I have BCX setup in SciTE:

I have choosen to use *.BCX as the file extension for BCX programs to allow me to have a separate setup for it.

*.bas is definined in vb.properties and would be overriden with every SciTE installer.

These steps should get you going:

Step 1

#######

Download and Install BCX DevSuite Pro which contain both BCX and The PellesC compiler components.

This will install to c:\Program Files\BCX DevSuite Pro

Step 2

#######

Add these to SciTEGlobal.properties: ( also make a copy of these changes since they will be lost when you update SciTE.)

1. add "*.bcx;" to this line: source.files=*.asm;*.au3;*.bcx;*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hxx;*.hpp;\

2. Add this line at the bottom: import bcx

3. save the File

Step 3

#######

Create bcx.properties in the SciTE program directory with below content and update command.build & command.help when needed:

== Start of bcx.properties =======================

# Define SciTE settings for BCX files.

# BAS: Module, FRM: Form, CLS: Class Module, CTL: User Control

# PAG: Property Page, DSR: Data Report, DOB: User Document

file.patterns.bcx=*.bcx

command.build.$(file.patterns.bcx)="C:\Program Files\BCX DevSuite Pro\Bin\PELLESC.BAT" CON UPX "$(FileName)"

command.build.subsystem.$(file.patterns.bcx)=0

command.help.$(file.patterns.bcx)=$(CurrentWord)!C:\Program Files\BCX DevSuite Pro\Bin\help\Bcxhelp.Chm

command.help.subsystem.$(file.patterns.bcx)=4

lexer.$(file.patterns.bcx)=vb

word.characters.$(file.patterns.bcx)=$(chars.alpha)$(chars.numeric).$_@#%!

# Keywords, operators, statements, data types and some words in .frm files

keywordclass.bcx=\

accelerator asm bcx bcx_resource bcxversion catch ccode class comment \

compiler cpp dll endclass endtry file fsstatic genfree header hscroll \

ifndef include iprint_off iprint_off iprint_on lcc leanandmean library \

linker namespace noini nolibmain nolibrary nomain nowin onentry onexit \

optimizeroff optimizeron pack pelles pp prj prjuse project resource \

source test trace try turbo typedef vscroll abs acos acosh alias and \

ansitowide appactivate append appexename appexepath argc argv argv as \

asc ascending asin asinh atanh atn auto band bcx_arc bcx_bitmap \

bcx_blackrect bcx_bmpbutton bcx_bmpheight bcx_bmpwidth bcx_button \

bcx_checkbox bcx_circle bcx_colordlg bcx_combobox bcx_control \

bcx_cursor bcx_datepick bcx_dialog bcx_mdialog bcx_edit bcx_ellipse \

bcx_floodfill bcx_fontdlg bcx_form bcx_get bcx_get_text bcx_get_updown \

bcx_getpixel bcx_grayrect bcx_group bcx_hinstance bcx_icon bcx_input \

bcx_label bcx_line bcx_lineto bcx_listbox bcx_listview bcx_loadbmp \

bcx_loadimage bcx_mdichild bcx_mdiclass bcx_mdiclient bcx_olepicture \

bcx_polybezier bcx_polygon bcx_polyline bcx_preset bcx_print \

bcx_progressbar bcx_pset bcx_put bcx_radio bcx_rectangle bcx_repeat \

bcx_resource bcx_richedit bcx_roundrect bcx_scalex bcx_scaley \

bcx_set_edit_color bcx_set_font bcx_set_form_color bcx_set_label_color \

bcx_set_text bcx_slider bcx_splitter bcx_status bcx_str bcx_tab \

bcx_thread bcx_threadend bcx_threadkill bcx_threadresume \

bcx_threadsuspend bcx_threadwait bcx_tile bcx_toolbar bcx_treeview \

bcx_updown bcx_whiterect bcxlib bcxpath begin bel bff bin bin2dec \

binary bnot bool bor bs byref c_declare call callback case cbctl \

cbctlmsg cbhndl cbhwnd cblparam cbmsg cbool cbwparam cdbl center chdir \

chdrive chr cint clear clng close cls color color_bg color_fg \

comboboxloadfile command concat console const containedin copyfile cos \

cosh cosl cr createregint createregstring crlf csng csrlin curdir \

cursorx cursory cvd cvi cvl cvs data date declare decr del delay \

delete deleteregkey descending dim do doevents download dq \

drawtransbmp dsplit dynamic editloadfile ejectpage else elseif enc end \

endif enum environ eof esc events exist exit exp export extern extract \

ff filelocked fillarray findfirst findfirstinstance findnext finput \

fix flush for fprint frac free freefile freeglobals function fwrite \

genfree get getattr getbmp getbvalue getc getdrive getfilename \

getgvalue getrvalue global gosub goto gui hex hex2dec hide hypot icon \

if iif imod in inchr include incr infobox inkey inkey inp input \

inputbox inputbuffer inputnumber inpw ins instat instr instrrev int \

iremove iremove ireplace ireplace is isptr iterate join keypress kill \

lcase lccpath left len lf lib like line listboxloadfile load_dll \

loadfile loadlibrary loc local locate lof log log10 loop lpad lprint \

ltrim max mcase mdigui mid min mkd mkdir mki mkl mks mod modstyle \

msgbox new next not now nul oct on open optional or osversion outp \

output outpw overloaded panel pause peek pellespath pixels playwav \

poke pos pow powl preserve print printer private program ptr put \

qbcolor qsort qsortidx randomize raw rec reccount reclen record redim \

regint register regstring rem remain remove rename repeat replace \

retain return reverse rewind rgb right rmdir rnd round rpad rtrim run \

savebmp scanerror screen searchpath seek select set set_bcx_bitmap \

set_bcx_bmpbutton set_bcx_icon setattr setformcolor setwindowrtftext \

sgn shared shell show sin sinh sinl sizeof sound space spc split \

sprint sqr sqrt sqrtl static stdcall step str strarray strim string \

strptr strtoken sub swap sysdir tab tally tan tanh tanl tempdir \

tempfilename textmode then this time timer to trim type ubound ucase \

union until using val vbs_addcode vbs_eval_num vbs_eval_str vbs_reset \

vbs_run_script vbs_start vbs_stop vchr verify vt wend while widetoansi \

windir with write xor

# html.properties picks up VB keywords from keywordclass.vb

keywords.$(file.patterns.bcx)=$(keywordclass.bcx)

comment.block.bcx='~

# VB styles

# Default

style.vb.32=$(font.base)

# White space

style.vb.0=

# Comment

style.vb.1=$(colour.code.comment.line),$(font.code.comment.line)

# Number

style.vb.2=$(colour.number)

# Keyword

style.vb.3=$(colour.keyword)

# String

style.vb.4=$(colour.string)

# Preprocessor (directives)

style.vb.5=$(colour.preproc)

# Operator

style.vb.6=$(colour.operator)

# Identifier

style.vb.7=

# Date

style.vb.8=$(colour.number)

# End of line where string is not closed

style.vb.9=$(style.stringeol)

# Other keywords (bozo test colors :-)

style.vb.10=$(style.vb.5),back:#D0FFD0

style.vb.11=$(style.vb.5),back:#D0D0FF

style.vb.12=$(style.vb.5),back:#FFD0D0

# VBScript styles same as VB styles

style.vbscript.0=$(style.vb.0)

style.vbscript.1=$(style.vb.1)

style.vbscript.2=$(style.vb.2)

style.vbscript.3=$(style.vb.3)

style.vbscript.4=$(style.vb.4)

style.vbscript.5=$(style.vb.5)

style.vbscript.6=$(style.vb.6)

style.vbscript.7=$(style.vb.7)

style.vbscript.8=$(style.vb.8)

style.vbscript.9=$(style.vb.9)

style.vbscript.10=$(style.vb.10)

style.vbscript.11=$(style.vb.11)

style.vbscript.12=$(style.vb.12)

# wscript

# normal execute

command.go.$(file.patterns.wscript)="$(FileName)"

command.go.subsystem.$(file.patterns.wscript)=2

# note we have no real "build"; rather "execute and capture

# compiletime and runtime errors"

== End of bcx.properties ==========================

Step 4

#######

Go to directory "c:\Program Files\BCX DevSuite Pro\bin" and Edit file PellesC.bat.

Add this line: "Copy %3.bcx %3.bas" as shown:

== Start of PellesC.bat =================

@ECHO OFF

REM ---------------------------------------------------------------

REM PELLESC Batch for BCX v1.18

REM Makes EXEs (CON and GUI and DLL and CCON and CGUI).

REM Usage : PELLESC.BAT [CON or GUI or DLL or CCON or CGUI] [uPX or NOUPX] ExtraFile1 ExtraFile2...

REM ---------------------------------------------------------------

Copy %3.bcx %3.bas

ECHO PellesC Batch for BCX v1.18

== End of PellesC.bat ============================

You are now ready to edit BCX programs and Compile them with F7

Edited by JdeB

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

Link to comment
Share on other sites

Excellent! Works fine. :nuke:

Thank you very much!

You didn't say anything about the Tidy source code, but it would be of course absolutely ok if you don't want to publish the code. :P

Just one last small question (I hadn't luck in searching the forum and I think it doesn't make much sense to open another thread for this):

Is it possible to change the default size of the Autocomplete / CallTips - Box?

(I mean this one -> http://www.autoitscript.com/autoit3/scite/..._files/scr3.png )

Link to comment
Share on other sites

  • Developers

Excellent! Works fine. :)

Thank you very much!

You didn't say anything about the Tidy source code, but it would be of course absolutely ok if you don't want to publish the code. :nuke:

Have no plans to publish the source of Tidy at this moment. It is more or less the same as the autoit3 script version as far as the logic is concerned, but of course lots of changes to make it work with BCX. Fun things like Dynamic arrays and Dynamic strings and its "un-forgivingness" towards Upper/Lower case, Number and Alphanumeric tests, stack overflows (the always interesting c000000005 dumps) ect ... :P

Just one last small question (I hadn't luck in searching the forum and I think it doesn't make much sense to open another thread for this):

Is it possible to change the default size of the Autocomplete / CallTips - Box?

(I mean this one -> http://www.autoitscript.com/autoit3/scite/..._files/scr3.png )

I don't think there's a parameter to set the size of the popup window.

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

Link to comment
Share on other sites

Have no plans to publish the source of Tidy at this moment.

OK, no problem.

but of course lots of changes to make it work with BCX. Fun things like Dynamic arrays and Dynamic strings and its "un-forgivingness" towards Upper/Lower case, Number and Alphanumeric tests, stack overflows (the always interesting c000000005 dumps) ect ... :P

Yes, that's what I was interested in. How things work in BCX compared to AutoIt. I hoped that I could learn something from your code. But maybe later... :nuke:

I don't think there's a parameter to set the size of the popup window.

OK, thanks for the answer!
Link to comment
Share on other sites

  • Developers

Yes, that's what I was interested in. How things work in BCX compared to AutoIt. I hoped that I could learn something from your code. But maybe later... :P

In my opinion the best way to learn it is just to do it :nuke:

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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