Jump to content

Recommended Posts

Posted (edited)

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:

Script1.au3

#include <Script2.au3>

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

Script2.au3

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

Console:

1
Script1.au3
3
Script1.au3

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
  • Developers
Posted

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

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

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