Modify ↓

#4113 new Feature Request

Make version of Execute() that can take multiple lines.

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

I am a ware of /AutoIt3ExecuteScript switch which allows me to run entire script with my compiled autoit exe. But problem is that this doesn't allow passing context.

Example code to illustrate how I would like to interact with context.

Line 
1Func Example($DynamicCode)
2 $ContextVariable = "Untitled - Notepad"
3 $hWnd = Execute($DynamicCode)
4 WinActivate($hWnd)
5EndFunc ;==>Example
6
7$DynamicCode = "$aList = WinList()" & @CRLF & _
8"For $i = 1 To $aList[0][0]" & @CRLF & _
9" If $aList[$i][0] = $ContextVariable Then" & @CRLF & _
10" return $aList[$i][1]" & @CRLF & _
11" EndIf" & @CRLF & _
12"Next"
13
14Example($DynamicCode)

And likewise assignment to $ContextVariable inside that $DynamicCode string would change the value of $ContextVariable that Example function sees.

Attachments (0)

Change History (0)

Modify Ticket

Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.