# #include personal udf diferent path

## Recommended Posts

hi guy,

i  have  a personal  udf , i  want insert them  in  config  folder , and   after  include  in  my program , the problem is  this  , if  i  write  in this  mode  #include "E:\_GEST\include\personaludf.au3"

work good  but  if  i  use  @scriptdir &"\include\personaludf.au3"  not  work

some one  can  help me???

and  at  finish if  i compile  my program ,  the  include udf  will  put inside the  exe ???

thankz

##### Share on other sites

If the UDF is in @ScriptDir use

#include "\include\personaludf.au3"

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:

##### Share on other sites

give me  thesame  error

: ==> Error opening the file.:

##### Share on other sites

I would guess your file directory is written wrong. Right click on the file properties on the .aug file and go to security and copy the file path. Replace it with mine to test whether it opens.

#include <C:\Program Files(x86) \AutoIt3\Include\_ColorPicker.au3>
a()

##### Share on other sites

but i dont  want  put  my udf  in include of  Autoit , i create a  folder in my script-directory , with name  include

##### Share on other sites
34 minutes ago, water said:

If the UDF is in @ScriptDir use

#include "\include\personaludf.au3"

Syntax is like this:

Quote

#include "[path\]filename"

So I think this should look like this:

#include "include\personaludf.au3"

Edited by mLipok
• 1

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-09-20

##### Share on other sites

It doesn't have to be in the AutoIt folder.

The #include simply calls the file.

#include <E:\_GEST\include\personaludf.au3>
a()

##### Share on other sites

o thankz  yea  work perfect now thankz  so much

##### Share on other sites

This is wrong:

#include <E:\_GEST\include\personaludf.au3>
a()

try this:

#include "E:\_GEST\include\personaludf.au3"
a()

EDIT: from HelpFile

Quote

If "..." is used, the filename is taken to be relative to the current script.
If <...> is used the filename is taken to be relative to include library directory (usually C:\Program Files\AutoIt3\Include). The include library contains many pre-written user-functions for you to use

Edited by mLipok
Forum editor is confusing me .....

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-09-20

##### Share on other sites
4 minutes ago, mLipok said:

This is wrong:

#include <E:\_GEST\include\personaludf.au3>
a()

try this:

#include "E:\_GEST\include\personaludf.au3"
a()

Either example will work. Tested.

##### Share on other sites
3 minutes ago, aa2zz6 said:

Either example will work. Tested

But the first according to the Langauge syntax is simply inproper, and can confuse.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-09-20

##### Share on other sites
Quote

But the first according to the Langauge syntax is simply inproper, and can confuse.

The syntax only defines search order for relative paths. If a full path is supplied you would have to try really really hard to be confused.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | -' | | -. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | --. | |) \ | |
-' |_| (_) | |\/| | -' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

##### Share on other sites

When you have your own modified UDF version and you try to use:

#include "ie.au3"

then this is different.

Once I was confused when I massivly cleaning up my script and changed some " to <> and in other way.

The confusion is when your mind expecting some behavior because he is using eyes.

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-09-20

##### Share on other sites

I feel that, I keep an old array.au3 around and am often baffled why i get inconsistent behavior, before realizing the mistake.  I dont know why I never used literal paths before, but i think thats my new goto for custom UDFs.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | -' | | -. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | --. | |) \ | |
-' |_| (_) | |\/| | -' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

##### Share on other sites

So you confirm that this is not to hard to be confused ?

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API *
How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * SMTP Mailer UDF *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
, be   and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-09-20

##### Share on other sites

post #9, neither syntax is confusing.  Relative paths can be confusing.  I also think the helpfile on this could be updated not only does not address that full paths can be used with either syntax, but it also has some confusing grammar

Quote

If Opt("TrayIconDebug",1) only 64 include files name can be displayed in the traytooltip. for the other no filename will be displayed.

for the other what will no filename be displayed?  Thats about the most awkward way to say, "If debug is not on, no debug information is provided", which is awkward to say anyway.

Edited by iamtheky

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | -' | | -. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | --. | |) \ | |
-' |_| (_) | |\/| | -' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)`

## Create an account

Register a new account