Jump to content
Sign in to follow this  
Graeme

Scripts broken with new AutoIt program

Recommended Posts

Graeme

I started programming in Nov with a script developed by a previous colleague. Today I updated the AutoIt compiler (because I accidently deleted Include files) and now nothing will compile! I mean it compiles but doesn't produce the same icon which I found odd and then when I ran it, it came up with an error in something I never touched!

How can I find the problem? I looked at the list of potential script breaking variables and found none of them.

Could I go back to the earlier version of AutoIT?

Blessings

Any help really appreciated.

Graeme

Share this post


Link to post
Share on other sites
Melba23

Graeme,

The new version of AutoIt does not provide a default icon - you now need a #pragma directive to define the one you wish to use. So look at pragma in the Help file to see what to do. :)

As to "when I ran it, it came up with an error", I am afraid my crystal ball is at the cleaners and so I am unable to help. If you were to provide the content of the SciTE console showing the error message we might be able to offer some help. ;)

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
Graeme

Hi Melba,

Thanks for your response. That is very helpful - though the icon is a minor issue I'll be glad to see it sorted.

The error message is to do with this piece of script though of course the actual problem could come from something earlier...

Func MonitorOpenVPNTunnel ($UDPLogReceiver)
    If $UDPLogReceiver[0] <> 0 Then
        $received = UDPRecv($UDPLogReceiver,16000)
        If @error And (@error <> 10040) Then
            InternalErrorMsgBox("UDPRecv",@error)

The UDPRecv function has produced an error (-1) and I wonder if those with more experience than me might know what I could look for. I think this means an socket didn't work but I haven't touched the sockets so all I can think of is that the program is handling the sockets differently because of the compiler being different.. How? Actually I was hoping that people who are using AutoIt much more than me and have used it for longer would have a better idea how to handle this sort of problem.. Not looking for any crystal ball gazing but just wanting to benefit from the experience of others rather than reinventing the wheel.

Actually the funny thing about the SciTE Console is that it didn't crash the program, but because this is a monitoring function, the one above, the program kept coming back to the same error message (InternalErrorMsgBox) and I had to stop the program with TaskManager the hard way.

Blessings

Graeme

Share this post


Link to post
Share on other sites
Melba23

Graeme,

Sorry, I know nothing about the UDP functions. I suggest you open a new thread with "UDP" in the title to attract those who do. ;)

M23

Edited by Melba23
Typo

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
jaberwacky

I don't know anything about UDP either, but I did see this at MSDN.  Make a call to WSAGetLastError to get an error code.  Then use this page to give you some more information to go on: http://msdn.microsoft.com/en-us/library/ms740668.aspx

Anyways, hope that does something!

Func MonitorOpenVPNTunnel ($UDPLogReceiver)
    If $UDPLogReceiver[0] <> 0 Then
        $received = UDPRecv($UDPLogReceiver,16000)
        If @error And (@error <> 10040) Then
            InternalErrorMsgBox("UDPRecv", @error)
            ConsoleWrite(DllCall("Ws2_32.dll", "int", "WSAGetLastError")[0] & @CRLF)

Share this post


Link to post
Share on other sites
Graeme

Just like I thought, there is more to this than meets the eye. Also, once I commented out the UDP function I realise the iniread has failed. Can I please go back to the older version of AutoIt? I can't read through 4000 lines of script to try and sort out what has happened. :(

Has anyone else had this sort of problem with the new version of AutoIt?

Blessings

Graeme

Share this post


Link to post
Share on other sites
Melba23

Graeme,

I can't read through 4000 lines of script to try and sort out what has happened

Why not? Do you want the script to work or not? :huh:

Go and read the changelog in the Help file to see what changed and then try to isolate those parts of the script which are affected by those changes - you will probably be surprised how few of those 4000 lines need to be looked at in the end. ;)

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
water

I don't hink IniRead has changed.

Without having seen your code I suspect that you do not have too much error checking in your code. For scripts you run in production you need to make sure that no possible error goes unnoticed.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Graeme

Thanks Melba,

But to be honest I looked at the change log and couldn't really understand what had changed. For someone that's been writing AutoIt script for a while this may seem easy but I only just started.:( 99% of the 4000 lines were written by someone else who knows a lot more about computers.

Blessings

Graeme

Share this post


Link to post
Share on other sites
Graeme

Thanks Water but if you saw the whole script you'd see a lot of error checking!

Blessings

Graeme

Share this post


Link to post
Share on other sites
water

But why should IniRead fail? What's the return value of IniRead?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
JLogan3o13

You state you only just started coding with AutoIt, you don't understand what has changed, you want us to assist, but you won't post your code in its entirety so we can help. Do you see where the disconnect is?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
BrewManNH

Can I please go back to the older version of AutoIt?

http://www.autoitscript.com/autoit3/files/archive/autoit/

Pick whichever previous version of AutoIt you'd like.

  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
Graeme

Dear all,

Thanks for all your comments.

Water - I must be more precise. IniRead didn't fail as in produce an error - it just didn't change the variables as expected and now I know why - I was trying a new way of testing my script - using F5. What I have now realised is that this means that it was running in a different place as I had previously moved the exe file after each compliation (too long to explain why) and so the program didn't find the ini file. That's why the values didn't change! Problem solved:) This is what happens when you change your work process..

Thank you JLogan for the offer but I don't think if I had posted the 4000+ lines of code you would have had the time to read and understand it all. I didn't want that kind of help but rather a pointer in how to find the error, what the recent changes to AutoIt might mean in the UDP area. As I said I started with a script developed by a past colleague. Maybe this is a bad way to start but it was going well..

BrewMan - wonderful. I'll try that approach though I suppose I should really figure out what the change log means for the script I'm working on so that in the future this won't happen again.

Blessings

Graeme

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.