Jump to content
Sign in to follow this  
jaberwacky

[SOLVED] @ScriptLineNumber and @ScriptName

Recommended Posts

jaberwacky

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

Share this post


Link to post
Share on other sites
Jos

#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 Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×