Jump to content

Organize includes in Scite


Recommended Posts

Are there known limitations concerning the lenght of the source? It seems like

$Source = ControlGetText('classname=SciTEWindow', '', 350)

does not fetch all of my sourcecode, resulting in missing includes and a cut of source when I insert includes.

After insertion the remaining source has 32 kilobyte.

Is it me or have I found something?

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Are there known limitations concerning the lenght of the source? It seems like

$Source = ControlGetText('classname=SciTEWindow', '', 350)

does not fetch all of my sourcecode, resulting in missing includes and a cut of source when I insert includes.

After insertion the remaining source has 32 kilobyte.

Is it me or have I found something?

Hi,

damn how many lines of code do you have? :rolleyes:

I just tested it with with 53000 lines and it worked quite well (after a few seconds)

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,

should be already implemented in the 1.3 version. All includes are listed, but only the necessary ones are selected.

If this doesn't work for you, then show me some code to check it. Thanks!

So long,

Mega

My bad, total stupidity on my part, lol, amazing work, I LOVE it :rolleyes:

[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

damn how many lines of code do you have? :rolleyes:

I just tested it with with 53000 lines and it worked quite well (after a few seconds)

No no, I just have 1100 lines, fifty-something kilobyte. And it gets cut at 32kb.

I added

StringReplace($Source, @CRLF, @CRLF)
MsgBox(0,"Debug", @extended & @CRLF & stringlen($source))

to function _start() in order to monitor this. Result is always the same: code gets cut at 32766 characters.

Ah, one moment. I am not using newest AutoIt-version. I am going to update and report results.

Link to comment
Share on other sites

No no, I just have 1100 lines, fifty-something kilobyte. And it gets cut at 32kb.

I added

StringReplace($Source, @CRLF, @CRLF)
MsgBox(0,"Debug", @extended & @CRLF & stringlen($source))

to function _start() in order to monitor this. Result is always the same: code gets cut at 32766 characters.

Ah, one moment. I am not using newest AutoIt-version. I am going to update and report results.

HI,

okay I'll be waiting for the results of your tests. How do you get more than 32 KB with 1100 lines of code?

When I got the time, I'll check the option to replace ControlGetText by FilRead...

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

okay I'll be waiting for the results of your tests.

Installation orgy finished. I always fail to remember to install AutoIt with admin rights and scite not.

Result: everything is working fine. Great tool. I use it to get rid of unnecessary includes too.

How do you get more than 32 KB with 1100 lines of code?

OrganizeIncludes has 7,5kb and 180 lines of code. take this 6 times and you got 45kb for 1080 lines. Edited by florisch
Link to comment
Share on other sites

  • 3 weeks later...

Hi,

new Version 2.0 with a lot of new things. See 1st post.

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

Hi,

Changed a little thing. See 1st post.

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

Version 2 is really nice. Good work.

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

Hi,

thanks! Let me know if you've got some questions or trouble using it. Maybe you've got any ideas for improvement. :whistle:

I just fixed a minor bug see 1st post.

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

Hi,

thanks! Let me know if you've got some questions or trouble using it. Maybe you've got any ideas for improvement. :lmao:

I just fixed a minor bug see 1st post.

Thanks!

So long,

Mega

This is an excellent add-on to Scite th.meger. Many thanks :whistle:

I have a few problems though. It tells me I don't need an include file although my script is calling functions in that file. If I remove the include I get 'undefined function' errors if I try to run the my script.

I am using OrganizeIncludes2.0.au3 and to make sure I have deleted version1. I edited the Scite user properties to have OrganizeIncludes2.0.au3.

If I reduce my script to 2 lines I still get the same problem:-

#include <ftpplus.au3>
$Open = _FTPOpen('MyFTP Control');this is a function in ftpplus.au3

Maybe it's because _FTPOpen is also defined in FTP.au3, but I don't want that include I want my own version. But in that case it should say "FTP.AU3 needed include" in status.

Could you include the version number in the title of your window or have an about option. Maybe include the version of your script in the ini file like you do with the Autoit version.

Also, it says I don't need an include even when it's commented out. (This is not a problem of course, more of a comment.)

I get 2 red lines saying I have <GuiConstants.au3> not needed although I only have this in my script once. I assume the other occurrance is in one of the include files.

If I choose to delete the ini then the next time I run your script it says "no files found", but after this it is ok.

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,

first - thanks for using!

What path are your own udf.au3 files saved? Are they saved in ...\AutoIt3\Include\ ? If not try saving them in the original include path and then delete the includes.ini and start again.

I will test this on my own. (I do not work with own include files very often!)

Adding the version number is a good idea. I will do that in version 2.1.

If you got functions with the same name in more then more include.au3 this will lead to problems.

(I'll check that) - Maybe I can find a good solution or just rename one func. :lmao:

Also, it says I don't need an include even when it's commented out. (This is not a problem of course, more of a comment.)

This part I don't understand. :whistle:

I get 2 red lines saying I have <GuiConstants.au3> not needed although I only have this in my script once. I assume the other occurrance is in one of the include files.

If I choose to delete the ini then the next time I run your script it says "no files found", but after this it is ok.

Okay, that is all about what is happening when you've got an own include.au3 file with some own includes or not.

I'll check that, too.

Normally, after every start the script checks whether there is an ini and if not, it automatically creates a new one. So, I can not reproduce the "no files found" 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

What path are your own udf.au3 files saved? Are they saved in ...\AutoIt3\Include\ ?

The file is in "..\Autoit3\beta\include". But since it was written

#include <ftpplus.au3>

then you can tell that it's in the standard path.

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

I like it. :whistle:

Hi,

thanks!

Okay, I figured out what you meant. If there is an include in your own include file, my script will not recognize that.

Example:

Let's say, in your ftp.au3 is array.au3 included then you needn't to include array.au3 again in your main script. That is true.

At the moment my script parses only the source of the main script and doesn't check whether there are already includes in the includes files of your main script.

Maybe I can implement it, but I do have to think about it whether this is worth the thing.

I added the version number and changed the thing with "no files found". This will not occur anymore.

For the other problem can you send me an example script with your includes via PN? Thanks!

I'll update 1st post for version 2.1 now.

So long,

Mega

Edited by th.meger

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,

thanks!

Okay, I figured out what you meant. If there is an include in your own include file, my script will not recognize that.

Example:

Let's say, in your ftp.au3 is array.au3 included then you needn't to include array.au3 again in your main script. That is true.

At the moment my script parses only the source of the main script and doesn't check whether there are already includes in the includes files of your main script.

Maybe I can implement it, but I do have to think about it whether this is worth the thing.

I added the version number and changed the thing with "no files found". This will not occur anymore.

For the other problem can you send me an example script with your includes via PN? Thanks!

I'll update 1st post for version 2.1 now.

So long,

Mega

If the bit below is no help then I will PN you.

If you have a script which consists of just this line

$Open = _FTPOpen('MyFTP Control')

then your include script says no includes needed. This is why when I have #include <ftpplus.au3> it says that it's not needed.

_FTPOpen is in the file ftpplus.au3 which is in my includes folder.

Was the problem with 'No Files Found' because the beta include folder was not set correctly? That would be the reason it says I don't need an include, because the _FTPOpen is not in the list of functions in the ini file.

I'll try your latest version and let you know if it fixes the problem.

EDIT: The problem is that this key doesn't exist on my PC

Global $betaInstallVersion = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt', 'betaVersion')

I have installed 3.2.3.14 again and now the key is there and your ini file contains all the functions in the beta include files.

However it still says I don't need ftpplus.au3. It also says I don't need 2 other includes which I haven't included.

this is the ftpplus.au3

Maybe the problem is that your script does not identify _FTPOpen as a function in a script.

Edited by 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

There might be a problem with

Local $iniContent = IniReadSection($includesIni, 'Functions')

Maybe Inireadsection assumes that the items in the section are alphabetically sorted, so after

Word.au3=_WordCreate;_WordAttach;_.... etc in the ini file

the next line starts with the first functions from the beta includes like this -

A3LLanMan.au3=_NetAPIBufferFree;_NetConnectionEnum;_NetFileCl

but these aren't read.

so the value of $iniContent[0][0] is wrong.

Haven't got time to look into this now, but since you write with iniwrite why aren't the lines alphabetically sorted?

Bit confused by this at the moment.

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,

I tried to analyse your problems. I saved your ftpplus.au3 file in c:\Programme\AutoIt3\Include\..

Then I deleted the ini, so that my script is forced to create a new one.

After that the functions from ftpplus.au3 are all in the includes.ini listed like see codebox below.

Then I created a new script like this:

$Open = _FTPOpen('MyFTP Control')

After that I started my script again and it tells me correctly that there is a needed include missing called FTPPlus.au3

So, everything seems to work fine. :whistle:

The problem when no beta is installed that my script also tried to read the includes folder of the beta version is fixed in 2.1. So, please try this with version 2.1.

[Version]
Beta=v3.2.3.14
Normal=v3.2.4.9
[Options]
Green=0x80FF80
Yellow=0xFFFF80
Red=0xEF3D4A
Keyword=;[Includes]
CopyToCliP=0
Del=0
Place=1
SilentMode=0
Created=2007/07/07 - 11:45:09
[Functions]
FTPplus.au3=_FTPOpen;_FTPConnect;_FTPPutFile;_FTPDelFile;_FTPRenameFile;_FTPMakeDir;_FTPDelDir;_FTPC

lose;_FTPPutFolderContents;_FTPListFiles;_FTPCommand;_FTPGetCurrentDir;_FtpSetCurrentDir;_FTPGetFile

Size;_FTPFileFindFirst;_FTPFileFindNext;_FTPFileFindClose;_FTPGetFile;_InternetGetLastResponseInfo;_

FileTimeToSystemTime;_Check;_GetLastError;_ShowError;_GetLastErrorMessage;_FormatMessage

Full list : http://www.file-upload.net/download-326892/includes.ini.html

P.S.: I recognized a problem in au3check when you include the file itself. I'll have to fix that, but that hasn't got anything to do with the problems you mentioned.

If you still got problems, then please send me your includes.ini and the script.

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

Hi,

I tried to analyse your problems. I saved your ftpplus.au3 file in c:\Programme\AutoIt3\Include\..

Then I deleted the ini, so that my script is forced to create a new one.

After that the functions from ftpplus.au3 are all in the includes.ini listed like see codebox below.

Then I created a new script like this:

$Open = _FTPOpen('MyFTP Control')

After that I started my script again and it tells me correctly that there is a needed include missing called FTPPlus.au3

So, everything seems to work fine. :whistle:

The problem when no beta is installed that my script also tried to read the includes folder of the beta version is fixed in 2.1. So, please try this with version 2.1.

[Version]
Beta=v3.2.3.14
Normal=v3.2.4.9
[Options]
Green=0x80FF80
Yellow=0xFFFF80
Red=0xEF3D4A
Keyword=;[Includes]
CopyToCliP=0
Del=0
Place=1
SilentMode=0
Created=2007/07/07 - 11:45:09
[Functions]
FTPplus.au3=_FTPOpen;_FTPConnect;_FTPPutFile;_FTPDelFile;_FTPRenameFile;_FTPMakeDir;_FTPDelDir;_FTPC




lose;_FTPPutFolderContents;_FTPListFiles;_FTPCommand;_FTPGetCurrentDir;_FtpSetCurrentDir;_FTPGetFile




Size;_FTPFileFindFirst;_FTPFileFindNext;_FTPFileFindClose;_FTPGetFile;_InternetGetLastResponseInfo;_




FileTimeToSystemTime;_Check;_GetLastError;_ShowError;_GetLastErrorMessage;_FormatMessage

Full list : http://www.file-upload.net/download-326892/includes.ini.html

P.S.: I recognized a problem in au3check when you include the file itself. I'll have to fix that, but that hasn't got anything to do with the problems you mentioned.

If you still got problems, then please send me your includes.ini and the script.

Thanks!

So long,

Mega

The problem when I use your script is that the IniReadSEction function does not operate correctly as I said in a previous post. The ini file your script produces has 84 files listed in the Finctions section. IniReadSection sets the value of $iniContent[0][0] to 55. The result of this is that none of the beta includes are referred to. My ftpplus.au3 is in the beta includes, and so your script says ity is not needed.

Here is the modification I made to GetIncludes so I could see the problem -

Func getIncludes()
    If Not FileExists($includesIni) Or (IniRead($includesIni, 'Version', 'beta', 'Error') <> $betaInstallVersion) Or _
            (IniRead($includesIni, 'Version', 'Normal', 'Error') <> $InstallVersion) Then _prepareOrganizeIncludes()
    Local $iniContent = IniReadSection($includesIni, 'Functions')
    MsgBox(0,'No. of files is',$iniContent[0][0]);<---says 55 but there are 84
    MsgBox(0,'the files for CommMG.au3 are',IniRead($includesIni,"Functions","CommMG.au3","none"));<---- works correctly
    If @error Then MsgBox(4096, '', 'Error occurred, probably no ini file.')
    For $i = 1 To $iniContent[0][0]
        Local $functionsInAU3 = StringSplit($iniContent[$i][1], ';')
        If @error Then
            If StringRegExp($Source, '(?i)' & $iniContent[$i][0] & '([ ]+|\()', 0) = 1 Then
                _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
                ExitLoop
            EndIf
        EndIf
        For $ii = 1 To UBound($functionsInAU3) - 1
            If StringRegExp($Source, '(?i)' & $functionsInAU3[$ii] & '([ ]+|\()', 0) = 1 Then
                _ArrayAdd($ToBeIncluded, $iniContent[$i][0])
                ExitLoop
            EndIf
        Next
    Next
    $green_A = $ToBeIncluded
    Return $ToBeIncluded
EndFunc;==>getInclud

Here is the ini file your script produces

[Version]
Beta=v3.2.3.14
Normal=v3.2.4.9
[Options]
Green=0x80FF80
Yellow=0xFFFF80
Red=0xEF3D4A
Keyword=;[Includes]
CopyToCliP=0
Del=0
Place=0
SilentMode=0
Created=2007/07/07 - 19:11:49
[Functions]
A3LAVI.au3=_AVI_Close;_AVI_Create;_AVI_Open;_AVI_OpenEx;_AVI_Play;_AVI_Seek;_AVI_Stop;_AVI_WM_COMMAN


.
.
.
Lots of lines deleted because they are no longer needed
.

XSkinIcon;XSkinIconButton;_GuiRoundCorners
_ControlHover.au3=_ControlHover

Because the include files are not being read, I do not think that my script has anything to do with the problem I have.

I do not know why it works for you though, but maybe it's becaus eo fthe number of include files in your includes.ini as explained below.

If I try this simple piece of code and save it in the OrganiseIncludes folder

$s = IniReadSection("includes.ini","Functions")
MsgBox(0,'entries = ',$s[0][0])

Then it again tells me that there are 55 entries. It's wrong because there are 84 and I conclude that IniREadSection is faulty.

if I remove inreadsection returns there are in fact

3 lines 54 81 lines

another 3 55 78

another 10 68 68!

after this removing more lines seems to give a correct return value. Therefore it seems that, with my ini file at least, IniReadSection is faulty for some values over 68 keys and maybe all values over 68.

In other words, I believe that the main problem I have with your script is not an error in your script at all.

BTW I'm using version 2.1

I would be grateful if you or anyone else could confirm this.

martin

EDIT: deleted lots of lines from the inifile copy which are no longer any help and just made this post a pain to read.

Edited by 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

Hi,

thanks! I also noticed the problem and made a "bug-report" or feature request here at 02:44 PM :P

http://www.autoitscript.com/forum/index.php?showtopic=49049

I made a small test version

[autoit]; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.2.4.9

; Author: Thorsten Meger

;

; Script Function:

; Organize Includes Version 2.1

;

; ----------------------------------------------------------------------------

;[includes]

#include<Array.au3>

#include<File.au3>

#include<GuiListView.au3>

#include<GuiStatusBar.au3>

#include<GUIConstants.au3>

#cs

* Pr

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