Jump to content

Include source after copmpiling


Recommended Posts

hi,

Is it possible to add code after compiling script? I think like that:

; Some functions

; download from web new code or include from other file another file, which could subsequently change

Exit

sory for my English

Link to comment
Share on other sites

let's say you wanna put your code in a text file called 'Test.txt'

Test()

Func Test()

MsgBox(0,'Msg Title','Hello')

EndFunc

To run the code in Test.txt use this

$TextFile = "Test.txt"
RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript ' & $TextFile)

You have to see Running Scripts in the help file

Link to comment
Share on other sites

  • Moderators

Hi, LuxiVDN. This is how I do it, in case I do something stupid and delete my source (not that that ever happens) ;) Using this method, the source file only gets put onto the machine when you want it, not every time you run the script.

You can make the switch for your command line anything you would like. In this case, if you execute "MySource.exe" /Extract from the Run line, it will extract the source code and then exit without actually running through the script.

If StringInStr($cmdlineRaw, "/Extract") Then
    FileInstall("C:MySource.au3", @TempDir & "MySource.au3", 1)
    Exit
EndIf

"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

This is how I do it, in case I do something stupid and delete my source (not that that ever happens) Posted Image Using this method, the source file only gets put onto the machine when you want it, not every time you run the script.

OUT-FREEKING-STANDING!!!! Time to go hunt up all my old source code and recompile it all using this method! This should be added to the WIKI or something (then again, maybe it's already there and I just haven't seen it until now).

Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".

Link to comment
Share on other sites

  • 2 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...