Jump to content

Scripts broken with new AutoIt program


Graeme
 Share

Go to solution Solved by BrewManNH,

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Moderators

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?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Solution

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.

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

Link to comment
Share on other sites

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

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