Jump to content

@ScriptLineNumber started returned -1 (Negative one)


Recommended Posts

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

Link to comment
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 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

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.

Link to comment
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

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