Sign in to follow this  
Followers 0
shawnmstout

Limit to Script SIze?

21 posts in this topic

#1 ·  Posted (edited)

for some reason my script is not showing up anymore past a certain point, is there a limit to how many lines it will read?

once it gets down to line 298 the menu item doesnt show up anymore

Reference: Running Processes

posted wrong script, look at 2nd Attachment

Edited by shawnmstout

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

2nd Attachment:

Line 252 Should of Had a ; before Printing Jobs

traymenu.au3

Edited by shawnmstout

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

In Case you want to test it out, attached is a zip file of all includes, the script to run is traymenu.au3

I am also on irc freenode in the autoit channel if you want to ask me any questions or contact me via skype or msn, thanks

i really am confused on this one

all_Includes_Plus_Script.zip

Edited by shawnmstout

Share this post


Link to post
Share on other sites

shawnmstout,

A quick look at your script suggests to me that you might be running up against a limit on the number of traymenu items - at a rough estimate I reckon you are creating over 2000 of them! That is one big tray menu!

I have no idea if AutoIt or Windows has such a limit, but I would strongly suggest changing your code so that you create GUIs to display the necessary data when required rather than creating such a massive menu structure at the outset.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

shawnmstout,

A quick look at your script suggests to me that you might be running up against a limit on the number of traymenu items - at a rough estimate I reckon you are creating over 2000 of them! That is one big tray menu!

I have no idea if AutoIt or Windows has such a limit, but I would strongly suggest changing your code so that you create GUIs to display the necessary data when required rather than creating such a massive menu structure at the outset.

M23

Yeah i figured something like that, havent made any gui's yet, any suggested tutorials?

I was hoping to get everything on the menu, but i guess its not possible

Share this post


Link to post
Share on other sites

Are you using the beta of autoit, I tried with 3.3.0.0 and it threw all kinds of errors at me:

C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(6,10) : ERROR: can't open include file <memstats.au3>
#Include <memstats.au3>
~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(8,10) : ERROR: can't open include file <config.au3>
#Include <config.au3>
~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(13,10) : ERROR: can't open include file <CompInfo.au3>
#include <CompInfo.au3>
~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(42,38) : WARNING: $drive: possibly used before declaration.
$rootShortcut = TrayCreateItem($drive,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(53,48) : WARNING: $name: possibly used before declaration.
$ProgramtempDirShortcut = TrayCreateItem($name &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(82,31) : WARNING: $tempDir: possibly used before declaration.
    ShellExecute($dfile, $tempDir,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(252,10) : ERROR: syntax error
Printing Jobs
~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(42,38) : ERROR: $drive: undeclared global variable.
$rootShortcut = TrayCreateItem($drive,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(90,28) : ERROR: _ComputerGetDrives(): undefined function.
    _ComputerGetDrives($Drives)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(111,23) : ERROR: _ComputerGetBIOS(): undefined function.
_ComputerGetBIOS($BIOS)
~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(141,48) : ERROR: _ComputerGetDependantServices(): undefined function.
_ComputerGetDependantServices($DependantService)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(154,30) : ERROR: _ComputerGetDesktops(): undefined function.
_ComputerGetDesktops($Desktop)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(184,21) : ERROR: _ComputerGetOSs(): undefined function.
_ComputerGetOSs($OSs)
~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3 - 10 error(s), 3 warning(s)

I can understand the include problems, but the others, like the used before declaration warnings are kinda blatant, unless those variables are created in the includes, if so, they should probably have better names, those look like script level variables instead of UDF variables. also the Syntax error, just requires a ";" at the beginning of the line.

Anymore beyond that I can't help with, I can't even get this to run due to the missing includes.


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

Are you using the beta of autoit, I tried with 3.3.0.0 and it threw all kinds of errors at me:

C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(6,10) : ERROR: can't open include file <memstats.au3>
 #Include <memstats.au3>
 ~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(8,10) : ERROR: can't open include file <config.au3>
 #Include <config.au3>
 ~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(13,10) : ERROR: can't open include file <CompInfo.au3>
 #include <CompInfo.au3>
 ~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(42,38) : WARNING: $drive: possibly used before declaration.
 $rootShortcut = TrayCreateItem($drive,
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(53,48) : WARNING: $name: possibly used before declaration.
 $ProgramtempDirShortcut = TrayCreateItem($name &
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(82,31) : WARNING: $tempDir: possibly used before declaration.
    ShellExecute($dfile, $tempDir,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(252,10) : ERROR: syntax error
 Printing Jobs
 ~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(42,38) : ERROR: $drive: undeclared global variable.
 $rootShortcut = TrayCreateItem($drive,
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(90,28) : ERROR: _ComputerGetDrives(): undefined function.
    _ComputerGetDrives($Drives)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(111,23) : ERROR: _ComputerGetBIOS(): undefined function.
 _ComputerGetBIOS($BIOS)
 ~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(141,48) : ERROR: _ComputerGetDependantServices(): undefined function.
 _ComputerGetDependantServices($DependantService)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(154,30) : ERROR: _ComputerGetDesktops(): undefined function.
 _ComputerGetDesktops($Desktop)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3(184,21) : ERROR: _ComputerGetOSs(): undefined function.
 _ComputerGetOSs($OSs)
 ~~~~~~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\temp-traymenu.au3 - 10 error(s), 3 warning(s)

I can understand the include problems, but the others, like the used before declaration warnings are kinda blatant, unless those variables are created in the includes, if so, they should probably have better names, those look like script level variables instead of UDF variables. also the Syntax error, just requires a ";" at the beginning of the line.

Anymore beyond that I can't help with, I can't even get this to run due to the missing includes.

Above you will see an attached zip file of all the includes, im not getting any errors on my end, and im running it from a separate directory using those includes with no errors, can you try to re-run it with the includes and see if you still get the errors?

Share this post


Link to post
Share on other sites

for creating guis use koda, for learning how to work them, I dunno, I'm just learning through Trial and error myself.


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

I did a quick syntax check and got this:

C:\Documents and Settings\nekkutta\My Documents\AutoIt\all_Includes_Plus_Script\traymenu.au3(289,17) : ERROR: $error previously declared as a 'Const'
    $error = @error
    ~~~~~~~~~~~~~~~^
C:\Documents and Settings\nekkutta\My Documents\AutoIt\all_Includes_Plus_Script\traymenu.au3(293,26) : ERROR: _ErrorMsg(): undefined function.
            _ErrorMsg($ERR_NO_INFO)
            ~~~~~~~~~~~~~~~~~~~~~~^

this might be causing a hang up in the script, this area is right before you stopped creating tray menu items.


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I did a quick syntax check and got this:

C:\Documents and Settings\nekkutta\My Documents\AutoIt\all_Includes_Plus_Script\traymenu.au3(289,17) : ERROR: $error previously declared as a 'Const'
    $error = @error
    ~~~~~~~~~~~~~~~^
 C:\Documents and Settings\nekkutta\My Documents\AutoIt\all_Includes_Plus_Script\traymenu.au3(293,26) : ERROR: _ErrorMsg(): undefined function.
            _ErrorMsg($ERR_NO_INFO)
            ~~~~~~~~~~~~~~~~~~~~~~^

this might be causing a hang up in the script, this area is right before you stopped creating tray menu items.

Updated Document

Try this one

I Just put that in there to see if i could find an error

traymenu.au3

Edited by shawnmstout

Share this post


Link to post
Share on other sites

no Errors, got running Processes, boy oh boy did I get running processes :) think you got it fixed.


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

no Errors, got running Processes, boy oh boy did I get running processes :) think you got it fixed.

so your seeing Running Processes?

i never got it myself. wierd

Im Attaching a Tool Tip for All Running Processes i can see it loading on my side, but its not loading the menu "Running Processes" to pick from, see what you get with this

Edited by shawnmstout

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

I did make one change, and that is in the includes, if you have all the includes in the same directory as your script, try using "..." instead of <...> the <> point to the autoit includes directory, the "" use a relative path to the script.

#Include "Constants.au3"
#Include "memstats.au3"
#Include "String.au3"
#Include "config.au3"
#include "ButtonConstants.au3"
#include "EditConstants.au3"
#include "GUIConstantsEx.au3"
#include "WindowsConstants.au3"
#include "CompInfo.au3"
#include "Array.au3"
Edited by nekkutta

[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

I did make one change, and that is in the includes, if you have all the includes in the same directory as your script, try using "..." instead of <...> the <> point to the autoit includes directory, the "" use a relative path to the script.

#Include "Constants.au3"
 #Include "memstats.au3"
 #Include "String.au3"
 #Include "config.au3"
 #include "ButtonConstants.au3"
 #include "EditConstants.au3"
 #include "GUIConstantsEx.au3"
 #include "WindowsConstants.au3"
 #include "CompInfo.au3"
 #include "Array.au3"

Didnt make a difference

Share this post


Link to post
Share on other sites

bump;

Share this post


Link to post
Share on other sites

it seems to take some time to populate the menu, lol if I click it right after it pops up after it launches it doesn't show the running processes, but if I wait a couple sec it will. maybe you should just use the name field for that menu, since it seems to only scroll a little bit above and below the screen.


[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Share this post


Link to post
Share on other sites

it seems to take some time to populate the menu, lol if I click it right after it pops up after it launches it doesn't show the running processes, but if I wait a couple sec it will. maybe you should just use the name field for that menu, since it seems to only scroll a little bit above and below the screen.

I did before, comment everything out exept for the name and i still didnt get a list

Share this post


Link to post
Share on other sites

there is some reason why its working on yours but not mine i added before the printing jobs

TrayTip("Menu Delayed","Please Wait while its loading",2,16)

Sleep(100000)

but still its not loading for me,

even if i wait 10 minutes

Share this post


Link to post
Share on other sites

bump;

Don't bump a post in 6 minutes, read my signature.

See the help file >> Appendix >> AutoIt3 Limits/Defaults >> TRAY_MAXITEMS.

That 505 is a bit low because I've successfully done it at over 700 but none the less there is an upper limit.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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
Sign in to follow this  
Followers 0