Jump to content

Organize includes in Scite


Recommended Posts

Yes, the test script gets over the problem with IniReadSection.

I read your post about the change request for > 32k and Smoke_N has posted a link there about fixes which I wish I'd looked at before.

Now that the problem with the ini is fixed, other problems can be seen.

Most of these problems can be avoided by specifying that the standard include folders must not have functions with the same name in more than one file. Otherwise, you report that several files are needed even though this would duplicate functions. But this is really just my untidyness and I can easily fix it.

There should be a way to add a temporary list for the script being checked for include files which are in different places,

Eg

#include "$placeWhereIKeepMyOwnIncludeFiles" & "\ftpplus.au3"

Maybe a way to ignore commented lines, eg

;#include <guiButton.au3> ; I'll need this later.

But even ignoring the above situations, I get incorrect results saying I need includes which I don't.

Here is a zip file which includes the script I have problems with, my includes.ini, and a screen shot of the output of your script. GuiButton, GuiREichEdit and GUiScrollBars are said to be needed but that is not correct because it runs fine without them.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The include GuiButton is said to be required in OrganizeIncludes because it has a function

Func SetBkColor

Set BkColor is being matched with

GuiCtrlSetBkColour

so the line

If StringRegExp($Source, '(?i)' & $functionsInAU3[$ii] & '([ ]+|\()', 0) = 1 Then

could be changed to

If StringRegExp($Source, '(?i)' & ' ' & $functionsInAU3[$ii] & '([ ]+|\()', 0) = 1 Then
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi,

thanks again. :whistle:

I made a next little test version. It is not that mature, but lets see whether we get a step ahead.

What did I try?

I added that an include file will not include itself (new color - blue) [because au3check crashed!]

Like you mentioned I trimmed the RegExp-search down to word bounds [because of SetBkColor and GuiCtrlSetBkColor]

I added ignoring of commented lines. They will be analysed and the result is shown (whether the are needed or not) but they will not be affected from deleting options anymore.

I added to analyze Constants.au3 ['$STDIN_CHILD', '$STDOUT_CHILD', '$STDERR_CHILD'] [because those constants are often used in RUN commands without a GUI]

I added a button to add udf folder for include files.

Add will add the path. After that all files in these folders are listed too. Next start of the script the new udfs will be analysed, too.

Del will delete ALL added pathes again.

This way you can decide what folders should be basis for the organize includes script.

Still to do : Check include files for already included other include files [eg. ftpplus.au3 includes already date.au3]

Besides, when you've got one functionname in more than one include file then this will of course lead to the result that every include is needed. I think two funcs with the name in two include files is always no good.

Edit : Deleted code

So long,

Mega

P.S.: Hope others will test it, too. If my own tests end successfully, I'll update 1st post soon.

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

posted new version 2.5 and added two screenshots for those who like to see things first. :whistle:

Thanks for testing/using!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

posted new version 2.5 and added two screenshots for those who like to see things first. :lmao:

It's a big improvement. :whistle: You must have missed a few beers to get that done since the last version! (Took me a while to find it - I was looking for th.meger. )

The 'add include path' is good. It needs a small change though because I use drive D:. Maybe make the code

Case $addIncludePath_B
            $path = FileSelectFolder('Choose a folder where "Organize includes" looks for your udfs', '\', 6, StringLeft(@ScriptDir, 3))

It would be good to be able to see the list of paths used for the includes, and perhaps be able to add or delete paths in the list. But I know this is being a bit fussy because I can see them by viewing the ini.

The tooltip takes a long time for me to read, (I'm a slow reader) and it disappears too soon. If you know how to increase the visible time I'd like to be told.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hi,

yes you are so damn right. :whistle:

I 've got a double pneumonia, that is why I could spend a lot of time scripting around. But that is also why I missed a city celebration. :lmao:

Okay, already thought of changing the directory, so ... yes I'll have to change that.

I'll make another GUI or the GUI a bit bigger to show the pathes.

I'll also have a look at the ToolTip thing.

Thanks!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

  • 2 months later...

I have this line in a script-

$MonItText = StringReplace($MonItText,"#include <dllcallback.au3>","#include " & "'" & $AutoItBetaexePath & "\Include\dllcallback.au3'")

OrganizeIncludes thinks that I have used #include <dllcallback> in my script, but I haven't.

martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • 1 month later...

This script looks fantastic, but either I can't get it to work, or I'm missing something obvious. I made the changes to au3.properties (not SCITEUser.properties, which didn't exist) and saved the file in the property directory under SCITE's. I can launch OrganizeIncludes from SCITE correctly, but I can't get it to do anything.

On first startup, it reads my includes folder and creates a "includes.ini" file, which appears to contain all of the functions in my includes. I've attached a copy of the generated includes.ini for an example. I assumed that the script would automatically list any #includes already in my source file and tell me whether or not they are necessary, as well as suggest any that are needed but not included. However, it doesn't list anything in the Includes pane. Nothing I do makes any difference; I've tried every combination of settings and buttons, but no love. I copied my Includes folder over to my C drive (AutoIt is installed on the D drive), just in case that was the problem, and tried manually adding the new folder with the "Add Include Path" button. I didn't think this would help, though, because obviously it's finding my Includes folder if it can read the functions in there, and it didn't help.

Am I doing something wrong? I'm using AutoIt beta v3.2.9.3, if it matters.

On a side note, I noticed you had the SCITE commands referenced as command number 36. I use Stumpii's graphical debugger, and I added it as command #35. When I added yours, it didn't show up. I had to comment out command 35 and rename yours from 36 to 35. Is SCITE limited to 35 commands, or is there a workaround so I can use both?

Link to comment
Share on other sites

Hi,

try using the latest version. (There is an installer) Organize Includes 3.0

I'll only work on that version when I got time.

Yes, you can use both. Just change the number and it will both appear unter menu-->Tools.

So long,

Mega

P.S.: You can also PM me, if you still got problems.

Edited by Xenobiologist

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Sorry, didn't realize that there was a newer version. It works great. Very useful tool - many thanks for it.

Hi,

no problem. Thanks!

I'll update the other thread when I finished to work on the things martin suggested.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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