Jump to content

[Solved] Need Simple Error Handler


CountyIT
 Share

Recommended Posts

I have never messed much with error handling but think I need to start :) I have had a complied script running for almost two days and then I did something that caused jupiter to allign with mars and up popped a syntax error (unable to parse statement). Being compiled it didn't really give me any idea where my error was. Is there a simple error handler that someone can point me too that will tell me the module and line number the error happened in even though it is compiled?

Edited by CountyIT
Link to comment
Share on other sites

i tried the error handler above and it didn't help. It did really nothing more then what the AutoIt error displayed. I played with it a little more. The problem is that when the .exe hits the error it gives me line 3271. I can't figure out what line 3271 is. I have a ton of includes and the only way I can think of to try and find line 3271 is to replace the #includes with the actual includes. Really messy.

I know the best way to find is is by running the script and not the compiled version but this error doesn't seem to happen often enough that I have to give out the exe so people can use it. So if a user does come back and say "It said parsing error in line 3271" how d I trace that back to the source code?

Link to comment
Share on other sites

  • 2 weeks later...

I'm not sure if using obfuscatoors helped. I got a "variable used without being declared in line 4054" When I obfuscate the script here is what I get:

Local $A06A8C0605F = DllCall($A4EF591062B, $A20F5A12E11, $A38F5B14439, $A50F5C1340B, $A2A9AB05B20, $A4BF5D1334E, $A50BB501C0A, $A27F5E10B29, $A01CB001C01, $A3EF5F10D3C, $A24CB101D31)

So how do I tell what line in what #include that is?

Link to comment
Share on other sites

  • Developers

Have you obfuscated this script?

If so, did you get any errors/warnings during obfuscation?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This whole obfuscate thing is kind of blowing my mind starting with the /striponly parameter. I cannot find that parameter in the documentaion. Yes there were a couple of warning and errors. There seems to be a lot of diffetent places that give you different ways of doing it. It there a clear, concise document somewhere on how to do this?

Link to comment
Share on other sites

  • Developers

... everything is documented in the Helpfile .... and why did you feel you could ignore these errors/warnings and assume things would simply run?

They have a purpose like to warn you that your script will likely not work anymore.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The script has been running fine for 6 months. I know you haven't really caught the gist of it but I am having problems understanding how to use the obfuscator. A link to the Helpfile on it would be fine. Care to point me to it?

Edited by CountyIT
Link to comment
Share on other sites

  • Developers

In SciTE press Ctrl+F1, select Extra Utilities and voila...

Not sure why you state I haven't caught the gist of it?

I wrote Obfuscator and am a little tired of people ignore the produced warnings and than stating they have problems.

My advise is not to use Obfuscator when you can't be bothered reading its output to avoid shooting yourself in the foot. ;)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Jos,

Considering your the one who created the program I would think you'd act a little more professional when it comes to helping people use it. You need to understand not everyone knows exactly how to use your program correctly just like a person going into autoIT might not know exactly how to create an array. It comes with time and help from good support of the community. Not badgering comments on how people don't know how to use it correctly from the person who made it. Try to be a little more understanding in the future. Remember, not everyone is an autoIT guru like yourself.

Edited by JonBMN
Link to comment
Share on other sites

  • Developers

Tried to start with some open questions but didn't feel getting a serious answer. On top of that: being told needing glasses isn't very professional either so you can tell your colleague he gets a serious answer when answering me in a serious manner.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

JonBMN,

That is very definitely not the way to speak to someone who has given as much to AutoIt and this forum as Jos.

There is a perfectly good section in the SciTE Help file explaining all the Obfuscator options and several threads on the forum dealing with it as well. If someone has a specific problem with the app, Jos is always very quick to provide an update. But merely complaining about it in general terms is not the way to go about getting help - particularly not when you have just insulted the author in another thread. :naughty:

The OP asked for pointers to a Help file for Obfuscator and was answered - if the OP had subsequent questions I am sure that they would have been answered. So I fail to see why you felt it necessary to post as you did. If you think Jos (and by analogy the other long-term members such as myself) have not spent their thousands of posts helping all-comers, just what do you think we have been doing? :huh:

May I suggest you think twice before posting such inflammatory remarks in future. ;)

M23

P.S. In response to your PM which I have just seen:

You stand no risk of being banned - why should we do such a thing? You are entitled to your opinion even if we consider it mistaken. However if you take such offence at one post where we are not falling over ourselves to type out complete instructions on something which is already well-documented then most of the threads here must cause you considerable pain.

As I pointed out above, the OP was directed to the Help file for Obfuscator - if he has specific questions I am sure they will be answered. But attacking Jos as you did is beyond the pale - an apology would be nice. :)

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

  • Developers

As I pointed out above, the OP was directed to the Help file for Obfuscator - if he has specific questions I am sure they will be answered. But attacking Jos as you did is beyond the pale - an apology would be nice. :)

I don't need an apology at all... I know i was a little harsh as well.

Simply post a serious question with enough information to be able to help you. The more professional you come across the less you are treated as the average scriptkiddy we have seen here too many times with these kind of questions.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

OK. Thanks JOS. Things are getting tense and I will try and de-esclate the situation. I do appreciated your help.

The original question was: "I am getting a variable used without being declared error in line 4054 of a compiled script. The script does not have 4054 lines of code so it must be in one of the include modules. How can I tell were line 4054 is".

Out of the blue I get a response to use obfuscator. All I can do is try and search the forum for obfuscator. I have no luck. I finally find a reference to it under "Downloads" from the AutoIT home page but I see it under "Included Utilities I’ve created for those running other editors" which to me would imply that it would be part of the SCITE4 editor that I am using. I can find no reference to it in the editor so I go ahead and download obfuscator.zip I was told to run it with the /striponly paramater but can't find where that parameter is even valid.

So I finally get it to run, look at the results and can no more tell where line 4054 came from then the many on the moon. I post the results and don't really get any help determining where line 4054 came from but am not told because obfuscator came back with errors/warning that my script won't run. Most the replies you get are "read the help file". I would love to but even as we speak no one has ever really pointed me to this magical, all powerful help file. I am still, even now, now sure where it is!

I am not a leech. I love to read and love to learn. All I am asking for it to be pointed in the right direction. If everyone was an AutoIT guru and knew all the answers there would be no need for a forum. The first several responses to many, many questions are "did you read the help file?", a better answer would be "did you read the file? here are a couple links...", "Why would you want to do that?" I did ask if I should do something. I decided what I wanted to do now I need help accomplishing what I have decided I wanted to do.

I thought that forums were designed for help and discussions. Too much time is spent on ridicule and chastisment.....

Link to comment
Share on other sites

  • Developers

The number of lines is coming from the fact that you are using includes, which can import a load of lines.

The Obfuscator /striponly suggestion is one that people put forward because that will merge your main script with all includes into one new script, strips all unneeded variables and Func's from this new file and then compiles the newly generate source.

Now, when you get an error on a line, you simply open this newly generate source file since the linenumbers will match.

The name of this file will be: YouScripName_Obfuscated.au3

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

CountyIT,

Taker a look at this post where I have explained how to use Obfuscator with the /STRIPONLY parameter. :)

no one has ever really pointed me to this magical, all powerful help file. I am still, even now, now sure where it is!

I hope you are joking! :o

Your_AutoIt_PathAutoIt3AutoIt3Help.exe

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

  • Developers

I hope you are joking! :o

Your_AutoIt_PathAutoIt3AutoIt3Help.exe

That is for AutoIt3.

I have created one for SciTE4AutoIt3 which explains stuff about SciTE and many of the accompanying utilities like AutoIt3Wrapper, Obfuscator and Tidy.

This file is found in %programfiles%AutoIt3SciTEScite4AutoIt3.chm but simply hit Ctrl+F1.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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