MerkurAlex Posted March 27, 2008 Share Posted March 27, 2008 I need a way to everytime i run my compiled script to define the functions in another file. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 #include "myfunctions.au3" Link to comment Share on other sites More sharing options...
MerkurAlex Posted March 27, 2008 Author Share Posted March 27, 2008 #include "myfunctions.au3"That will include the functions when i compile not everytime i run the compiled script. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Swift Posted March 27, 2008 Share Posted March 27, 2008 That will include the functions when i compile not everytime i run the compiled script.And that made no sense it will include when I compile, not everytime I run the compiled script...?If you #include it, it's in the script when you run, and when you compile it. Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 And that made no sense it will include when I compile, not everytime I run the compiled script...?If you #include it, it's in the script when you run, and when you compile it.That is correct, the included files don't have to travel with your exe. Link to comment Share on other sites More sharing options...
MerkurAlex Posted March 27, 2008 Author Share Posted March 27, 2008 (edited) And that made no sense it will include when I compile, not everytime I run the compiled script...?If you #include it, it's in the script when you run, and when you compile it.Its seriously not that hard to understand after i compile the script if i run that exe it needs to define function from a file that can change that way the exe itself doesn't need to be recompiled.That is correct, the included files don't have to travel with your exe.I know that and if i didn't i would have tested and i would have found out the thing is i need it to be able to travel with the exe. Edited March 27, 2008 by EagleClaw [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
weaponx Posted March 27, 2008 Share Posted March 27, 2008 This would require a DLL file. Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 27, 2008 Share Posted March 27, 2008 You can't. Plain and simple. Link to comment Share on other sites More sharing options...
Danny35d Posted March 27, 2008 Share Posted March 27, 2008 Search the help file for Command Line Parameters and read about AutoIt specific command Line Switches you will find the following switches:Form3: Compiled.exe [/ErrorStdOut] [/AutoIt3ExecuteScript] file [params ...] Execute another script file from a compiled AutoIt3 Script File. Then you don't need to fileinstall another copy of AutoIT3.exe in your compiled file.Form4: AutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine "command line" Execute one line of code. AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 28, 2008 Share Posted March 28, 2008 He wants to call functions from a source file. Link to comment Share on other sites More sharing options...
Danny35d Posted March 28, 2008 Share Posted March 28, 2008 He wants to call functions from a source file.And your point is... Take any of your compiled script and run from the command window: Compiled.exe /AutoItExecuteScript Function.au3 "_MsgBox" "This is testing _MsgBox Function" Function.au3Local $ExecuteFunc If $CMDLine[0] > 0 Then $ExecuteFunc = $CMDLine[1] & '(' For $x = 2 To $CMDLine[0] $ExecuteFunc &= '"' & $CMDLine[$x] & '",' Next $ExecuteFunc = StringTrimRight($ExecuteFunc, 1) & ')' EndIf Execute($ExecuteFunc) Func _MsgBox($sTitle, $sText) MsgBox(0, $sTitle, $sText) EndFunc AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 28, 2008 Share Posted March 28, 2008 That doesn't allow it to return a value to the calling script with the exception of an integer through the exit code. I'm sure the return value ought to be important. Link to comment Share on other sites More sharing options...
Distrophy Posted March 28, 2008 Share Posted March 28, 2008 When this happens in the real world it usually means you 1: need to make another executable or more likely 2: need to rethink how you are coding your file to begin with. Nobody pulls functions from a separate file, there might be an easier way if you explain what you're trying to do. Link to comment Share on other sites More sharing options...
MerkurAlex Posted March 28, 2008 Author Share Posted March 28, 2008 @Distrophy Im basically trying to allow the user to write a function that can be added as an addon for other people but i still need to be able to keep the source code of my actual script hidden. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 28, 2008 Share Posted March 28, 2008 If you want users to be able to write their own functions, tell them to write dlls and call their dlls. That's how addons usually work unless you feel like implementing a parsing engine. 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