Sign in to follow this  
Followers 0
Gubba1

@ScriptLineNumber started returned -1 (Negative one)

5 posts in this topic

Used very successfully the @ScriptLineNumber in my 1042 line script to write out the line number to my logfile. After making a few minor changes (<20 new or updated lines), now @ScriptLineNumber is returning -1 (negative one) for all calls to it. I copied the first few 100 lines of code or so, compiled and found @ScripLineNumber then works fine. I am a loss what to do, other than throw today's work away. Any thoughts or suggestions?

P.S. One can not search these forums for "-1" (with or without quotes) for the results always state: "No results found for '1'."

Share this post


Link to post
Share on other sites



Compiled a version of the code from last Thursday that was working as expected.

After today's compilation it is broke too.

Share this post


Link to post
Share on other sites

The help file states for @ScriptLineNumber: "(Not significant in complied script)"

I never got anything else than -1 from a compiled script (but I don't use it very often).


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

Based on the previous comment and some additional experimentation, I've figured out my issue. When I run the script from within the Scite editing environment via the F5 (Go) key, I get line numbers appearing in the log file as expected. When I run the compiled .EXE (e.g., activating from MS Windows Explorer), I get the "-1" as the Help indicates.

Drat - wish there was some way to get line numbers all the time, regardless of what is being run where, even if this meant a script that ran slower or needed additional configuration.

Share this post


Link to post
Share on other sites

@ScriptLineNumber only returns a valid number when you run the uncompiled .au3 like SciTe does. You can execute the .au3 from Explorer, too and the numbers will show. Only with the exe it does not work.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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