Jump to content

is it possible to read code from a file?


Recommended Posts

What you mean then?

You want to make a kind of macro's, instead of compile it to .exe?

So in example you make a text file called "code.txt".

In "code.txt" is written "msg: hello world".

And you want to make a msgbox with "hello world" from your compiled script.

Many times you need to think like hobby-bob:')

Link to comment
Share on other sites

So you will have something like this:

#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("C:\code.txt",$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    If StringRegExp($aRecords[$x],'(?i)MsgBox') Then
    MsgBox(0,"test","regexp true")
    EndIf
Next
Edited by Gideon

Many times you need to think like hobby-bob:')

Link to comment
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
 Share

  • Recently Browsing   0 members

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