Sign in to follow this  
Followers 0
AndyS01

How do i add my own UDF?

7 posts in this topic

I have a library of related functions that I want to make into a UDF so I can have tool tips, function parameters, etc, but I cannot see how to do this.

Share this post


Link to post
Share on other sites



You put all your functions into 1 au3 file.

example myfuncs.au3

you have the au3 in the same directory of your script, or use full/reletive path to it, if its in same folder, add this to your script

#include 'myfuncs.au3'

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

But that doesn't make it a UDF. What I'm trying to do is have the editor automatically prompt me for the correct parameters for my functions (that are all in myfuncs.au3) when I type the function name. I get this for the various UDFs (like FileOpen, _ArrayAdd, etc.) but not for my functions.

Andy

Share this post


Link to post
Share on other sites

That does make it a UDF. What your asking for is 'Call Tips' in your editor, which has nothing to do with AutoIt. You will have to check the help file of your editor. I am assuming you are using Scite, and if so, open the Scite Help File. and see sections:

Scite/AutoIt3 - User CallTips &

Scite/AutoIt3 - User UDFs Syntax Highlighting.

Those 2 files should help you with what your looking for.


My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry.  

Share this post


Link to post
Share on other sites

You have to add the list of your functions to the editor to have it know about them. It's not done automatically. I don't use SciTe but those that do can tell you the relevant files to modify to add those functions into the intellisense in SciTe.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Func Something()
    Return False
EndFunc

There. Save that as an .au3 and it is a UDF in the sense we use the word on this forum. What you want is User CallTips. Look it up in the SciTE help under the help-menu in SciTE.

And install SciTE4AutoIt3 if you haven't (called "AutoIt Script Editor" on the AutoIt download page)

Edit: too slow ;)

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites

Thank you very much! The answer was to add my function info in the au3.user.calltips.api file.

Andy

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  
Followers 0