Fractured Posted August 29, 2018 Share Posted August 29, 2018 Just a quick general question. I have a program written for work that is a Universal Testing Application. It has 6 user created UDF's that hold the commands for the units and a core program. I am constantly evolving it as I learn more about autoit, but keep running into errors, since there are times im calling functions & variables that are in other UDF's. So my biggest questions are: 1. Should I create a variables section in my core program, so all are declared from the beginning, even if they are in the other UDF's? 2. Should I make a variable only UDF? 3. How do I call functions from other UDF's without having each UDF have an includes section? (Does including the UDF's this way create more overhead?) Thoughts? Suggestions? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 29, 2018 Moderators Share Posted August 29, 2018 This section on the Wiki gives you best practice for creating and UDFs; I think it will answer at least some of your questions. https://www.autoitscript.com/wiki/UDF-spec "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
water Posted August 29, 2018 Share Posted August 29, 2018 (edited) When using the Au3Stripper tool unneeded (not used in your script) functions and variables get stripped out of the code before compilation. So you can include as many UDFs as you want without creating overhead. Edited August 29, 2018 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Fractured Posted August 29, 2018 Author Share Posted August 29, 2018 thanks for the quick replies...rereading best practices UDF's....read it when I first started playing with autoit but JLOGAN3O13 reminded me it exists!! Time to update my brain on a few things! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now