MCP Posted September 28, 2007 Share Posted September 28, 2007 if i create a new .au3 file and simply put two functions and i compile it, i should get an executable that simply does nothing. But can i directly access one of those functions from another executable / script? is there anything like Run("MyDoNuthing.exe:FunctionOne()") to access them? Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 28, 2007 Share Posted September 28, 2007 (edited) if i create a new .au3 file and simply put two functions and i compile it, i should get an executable that simply does nothing. But can i directly access one of those functions from another executable / script? is there anything like Run("MyDoNuthing.exe:FunctionOne()") to access them? Perhaps you are thinking of AutoItX? The more common way to do that would be with command line switches: MyDoNuthing.exe /FunctionOne Edit: If the call is from an AutoIt script, then you could just include you functions as a UDF in those scripts: #include <MyDoNuthing.au3> Edited September 28, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
BrettF Posted September 28, 2007 Share Posted September 28, 2007 if i create a new .au3 file and simply put two functions and i compile it, i should get an executable that simply does nothing. But can i directly access one of those functions from another executable / script? is there anything like Run("MyDoNuthing.exe:FunctionOne()") to access them?Say your compiled script is: MsgBox (0, "The command line was:", $CmdLine[$CmdLine[0]]); $CmdLine[$CmdLine[0]] returns the last parameter compile it as "run.exe" and run it using the following code: ShellExecute ('run.exe', '"This will be shown"') Now, if you add an if...then...else...endif then you should be able to call different functions. Hope it helps Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Uten Posted September 28, 2007 Share Posted September 28, 2007 To answer your question (as I understand it) short. No, you can only use include files at compile time. There has been clever workarounds to this limitation. CoRoutine by neogia is one sample. The problem is communication between the scripts. Passing variables (by reference would be great) getting return values. So, your best and most efficient bet if you want to create a library is to use another basic compiler (freebasic sample. Emergence basic looks promising to) or c/c++ (the autoit plugin api is one place to start. Unfortunately it has some short comings at the moment)Happy scripting Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
MCP Posted September 28, 2007 Author Share Posted September 28, 2007 Thanks to all of you guys. Now I am ready for further investigations in the shown/underlined/possible directions. 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