Jump to content

[SOLVED] @ScriptLineNumber and @ScriptName

Recommended Posts

I did some minor preliminary searching before posting this but I didn't find anything. Please forgive me if this question has been asked.

I noticed that @ScriptLineNumber returns the line number of the au3 file in which the macro is located, however @ScriptName returns the name of the top level script.

For instance:


#include <Script2.au3>

ConsoleWrite(@ScriptLineNumber & @CRLF)
ConsoleWrite(@ScriptName & @CRLF)


ConsoleWrite(@ScriptLineNumber & @CRLF)
ConsoleWrite(@ScriptName & @CRLF)



Is that intended? If so then should I ask for a macro that will give the name of the script in which the macro is located?

Edited by LaCastiglione
Link to post
Share on other sites
  • Developers

#include is a preprocessor statement which makes the code inside of that included file to be merged into a single file before the actual running of the script.

The marco's return the scriptline number from the merged scriptcode and the included filenames are not know anymore.


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 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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...