Jump to content

Detect if included


Recommended Posts

I already have a strong suspicion that the answer to this is, "No. It can't be done." but I'll ask anyway.

Is there any way for a script to detect whether it is running as the main script, or if it is being included in another script?

Link to comment
Share on other sites

I have no certain answer, but I think that there is a way to determine if the exe file was extracted (being as a child from other process) or it is the only process. May be this could be done analyzing process table before process and after it. This is my opinion.

Link to comment
Share on other sites

@electrico

Thank you for your reply. I probably wasn't very clear on what I was looking for.

I am looking to have the script (compiled or not) determine if it is being run as a script, or being included as a UDF.

Link to comment
Share on other sites

Not possible. The reason is that if you are using #include, it should be a file that is always meant to be #include-d.

That is what I suspected. Thank you.

Link to comment
Share on other sites

  • 12 years later...
  • Developers

@_Ed_, You do realize you are answering an 12+ years old thread?  Please don't and stick to recent topics! 

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 comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...