Jump to content
Sign in to follow this  
Levignot

Create own library [solved]

Recommended Posts

Levignot

Good day!

Sorry about my english.

I would like to create my own library with the functions that I use in most of my scripts.

I don't know if it is possible, maybe some one can throw me any clue about.

The idea is to make a script (? library?), with many functions, and call this functions from my others scripts.

Thanks in advance for any help.

Edited by Levignot

Share this post


Link to post
Share on other sites
Melba23

Levignot,

What you are looking for is a personal include folder. :idea:

AutoIt looks for #include files in 3 places:

- 1. C:\Program Files\AutoIt3\Include (if you have a standard installation).

- 2. A user-defined folder (which is what you want). :)

- 3. The script folder.

So how do you tell Autoit where the user-defined folder is? Two ways to do it:

- 1. If you run the full SciTE4AutoIt3 package, you can use "SciTE Config" from the <Tools> menu to set the folder. (If you do not have the full package, then I recommend that you download it from here and install it. You get a load of goodies to help you code in AutoIt. :) )

- 2. Or you can edit the registry directly. As it says in 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.

Once you have defined the user-defined folder, you will need to save files containing the functions that you want in that folder. Then when you need a function, you can simply #include the relevant file.

I hope that is all clear - ask if not. :(

M23

Avec un nom pareil je presume que tu es francophone. Envoie-moi un PM en francais si tu ne comprends pas. :)

Trans: With that forum name I assume you speak French. Send me a PM in French if you do not understand.


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

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Levignot

Thanks so much!

I've just keep searching and found the include "method".

It's clear in help, but with your explication i've understand it even better.

If someone looks here, I recomend for search the function include in help, but anyway I've the example of the help:

;;;SCRIPT= TIME.aue3;;;

#include-once

Func myFunc()

MsgBox(0,"", "Hello from library.au3")

EndFunc

;;; SCRIPT.AU3 ;;;

#include "TIME.au3"

myFunc()

Exit

One more time, Thanks! For your fast and "accuracity" reply.

PD: Sorry, I'm spanish, and my knowlegde about french is horrible unfortunally.

P.P.D: Now I understand better your great reply. I've make my own folder and put there some files, It works great!

Thanks!

Edited by Levignot

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  

×