Jump to content

Trouble with #include....


Recommended Posts

Lets say I have my script in C:\Script\Bin\ and the file I want to include is in C:\Script\Include\

How can I include the file without hard-coding the path?? (or can't I??)

Link to comment
Share on other sites

Lets say I have my script in C:\Script\Bin\ and the file I want to include is in C:\Script\Include\

How can I include the file without hard-coding the path?? (or can't I??)

From the help for #include

There is a special registry value that can be created at "HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt" called "Include". It should be a REG_SZ (string) value. The contents of this value are a semi-colon delimited list of directories that should be searched for files when resolving #include's in addition to the standard locations.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Developers

You need to code at least the relative path. something like this should do it :

#include"..\include\yourfile.au3"

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

From the help file:

There is a special registry value that can be created at "HKEY_CURRENT_USER\Software\AutoIt v3\AutoIt" called "Include". It should be a REG_SZ (string) value. The contents of this value are a semi-colon delimited list of directories that should be searched for files when resolving #include's in addition to the standard locations.

EDIT: This will allow you to call #include and have it search additional directories, but those have to be hard coded in the registry.

EDIT2: Sorry Martin, didn't see that you already posted this.

Edited by danwilli
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...