Jump to content

How to use Include in multiple scripts


Recommended Posts

If you want several instances of this script in the same directory (say, to email different files or to send to different email addresses, how do you do it? If you change the file name from file.au3 it doesn't work and if you change both the file name and the "include" statement it doesn't work. I guess I'm stuck on the "include" statement and how it works.

Link to comment
Share on other sites

  • Developers

If you want several instances of this script in the same directory (say, to email different files or to send to different email addresses, how do you do it? If you change the file name from file.au3 it doesn't work and if you change both the file name and the "include" statement it doesn't work. I guess I'm stuck on the "include" statement and how it works.

Moved from _INetSmtpMailCom thread to Support forum as this is a generic syntax questions.

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

Link to comment
Share on other sites

If you want several instances of this script in the same directory (say, to email different files or to send to different email addresses, how do you do it? If you change the file name from file.au3 it doesn't work and if you change both the file name and the "include" statement it doesn't work. I guess I'm stuck on the "include" statement and how it works.

You could put this at the top of a hundred different scripts:
#include <_INetSmtpMail.au3>

It might be worth your while to review the help file for the search path used to find an include file:

Using #include <>

1. Standard library: The path of the currently running interpreter with "\Include" appended is searched.

2. User-defined libraries: The registry value mentioned above is read and each directory is searched in the order they appear in.

3. Script directory: The directory of the currently executing script.

The contents of _INetSmtpMail.au3 should be generic functions that will be exactly the same in each different script. The script code that calls those functions also provides the run-time specific data like email addresses in the values passed to those functions.

The contents of _INetSmtpMail.au3 itself should not be changed at any point.

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...