Oldschool Posted February 19, 2008 Share Posted February 19, 2008 (edited) Put testing.au3 @ScriptDir, compile the script and execute. ;testingDynFuncs #Include <File.au3> #Include <IE.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\testing.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_DynFunc("31")) Func _DynFunc($number) Local $oIE For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return "It Works!" EndFunc ;<===_DynFunc testing.au3 If $number > 30 Then $oIE = _IECreate( "www.autoitscript.com/images/autoit_6_240x100.jpg", 1, 1) WinMove($oIE, "", 0, 0, 600, 800) _IELoadWait($oIE) MouseClick("Left", 450, 105) Send("{BACKSPACE 50}") Send("http://www.autoitscript.com/forum/index.php?showtopic=63654") Send("{ENTER}") Sleep(5000) DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "Too bad you can't smoke it!", "str", "Dynamic Func", "int", 0) Edited February 20, 2008 by Oldschool Link to comment Share on other sites More sharing options...
Delta Posted February 21, 2008 Share Posted February 21, 2008 I'm a little confused what exactly is this? [size="1"]Please stop confusing "how to" with "how do"[/size] Link to comment Share on other sites More sharing options...
Richard Robertson Posted February 21, 2008 Share Posted February 21, 2008 AutoIt already has plugins. They are simply undocumented. Plugins probably shouldn't be open source because then the end user could (intentionally or not) change the code and cause problems. Link to comment Share on other sites More sharing options...
Oldschool Posted February 21, 2008 Author Share Posted February 21, 2008 I'm a little confused what exactly is this?This is an example of a compiled script executing an external function. Link to comment Share on other sites More sharing options...
Oldschool Posted February 21, 2008 Author Share Posted February 21, 2008 (edited) AutoIt already has plugins. They are simply undocumented.They are now.Plugins probably shouldn't be open source because then the end user could (intentionally or not) change the code and cause problems.In my particular case, or as can be seen here:http://www.autoitscript.com/forum/index.ph...c=63528&hl=having open source user defined functions is required or desirable.The whole point of this script is to allow the end users to add proprietary logic to certain functions of the script without reveling their logic to the developer. At the same time the developer does not have to share his source with the end user. This makes your program customizable without the need to recompile. Edited February 21, 2008 by Oldschool Link to comment Share on other sites More sharing options...
A. Percy Posted February 21, 2008 Share Posted February 21, 2008 A good example about using plugins is here (Zip Plugin by eltorro). Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral Link to comment Share on other sites More sharing options...
Uten Posted February 21, 2008 Share Posted February 21, 2008 (edited) EDIT: I Need new glasses.. Thanks to OldSchool for the sample belove. I have updated my code here so it works to as I find the func names used by Oldschool misleading. But That is probably due to different minds interpreting differently :waco: The whole point of this script is to allow the end users to add proprietary logic to certain functions of the script without reveling their logic to the developer. At the same time the developer does not have to share his source with the end user. This makes your program customizable without the need to recompile.Could you please provide a sample where the user calls a function in your script and gets a return value from the call? Say you have a function AppLog($msg) function in your main script. And the user wants to write to the log. Something like this (does not work as I expect.. ) expandcollapse popup#Include <File.au3> #Include <IE.au3> Global $DynamicFuncs Func Main() ; Cleanup old and write new test script Local $file = @ScriptDir & "\testing.au3" FileDelete($file) FileWrite($file, 'If 0 = AppLog("Log This") Then AppLog("Oh, NO UNEXPECTED!")' & @CRLF) FileWrite($file, 'If 911 = AppLog("And this") Then AppLog("Error 911")' & @CRLF) ; Execute test script If ReadPlugin($file) Then ScriptRun("31") ; TODO: Add error handling and legal check of script EndFunc ; === Read the plugin (script) file. Func ReadPlugin($file) If Not _FileReadToArray($file, $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Return SetError(1, 0, 0) EndIf Return 1 EndFunc ; === Func AppLog($msg) ConsoleWrite("--> AppLog(" & $msg & ")" & @crlf) Return 911 EndFunc ; === ScriptRun Used to be _DynFunc. Dependency on global array should be removed. Func ScriptRun($number) Local $oIE For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return 1 EndFunc ;<===_DynFunc ; === Call main Main() Edited February 21, 2008 by Uten 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...
Oldschool Posted February 21, 2008 Author Share Posted February 21, 2008 (edited) Could you please provide a sample where the user calls a function in your script and gets a return value from the call? Say you have a function AppLog($msg) function in your main script. And the user wants to write to the log. Something like this (does not work as I expect.. ) #Include <File.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\UserDefined.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_DynFunc()) Func _DynFunc() Local $file = @ScriptDir & "\mylog.txt" For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return "Just finished logging some stuff!" EndFunc ;<===_DynFunc UserDefined.au3 _FileWriteLog($file, 'AppLog("Log this")') _FileWriteLog($file, 'AppLog("And this")') Edited February 21, 2008 by Oldschool Link to comment Share on other sites More sharing options...
Oldschool Posted February 21, 2008 Author Share Posted February 21, 2008 (edited) And here is return coming back to a user: #Include <File.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\UserDefined.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_CatchAReturn("31")) Func _CatchAReturn($number) For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next EndFunc ;<===_CatchAReturn UserDefined.au3 If $number < 30 Then Return $number + 5 If $number > 30 Then Return $number - 5 In this case the return is "26" Edited February 21, 2008 by Oldschool Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2008 Share Posted February 21, 2008 Have you managed to execute an external loop yet?? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Uten Posted February 21, 2008 Share Posted February 21, 2008 Thanks for the samples. I have updated my post a bit as it just reflected my need for new glasses (possibly with the brand new BBTK (bug behind the keyboard) feature.. ) 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...
Oldschool Posted February 21, 2008 Author Share Posted February 21, 2008 Have you managed to execute an external loop yet?? Yes and no. I have been able to execute a loop, just have not been able to stop it so far... expandcollapse popup#Include <File.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\UserDefined.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_DynFunc2()) Func _DynFunc2() Local $file = @ScriptDir & "\mylog.txt" Local $counter Local $EndLoop For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "While") For $c = $i To $DynamicFuncs[0] If StringInStr($DynamicFuncs[$c], "WEnd") Then $EndLoop = $c ExitLoop EndIf Next $var3 = StringRegExp($DynamicFuncs[$i], '(?i)While(.*)', 3) While Execute($var3[0]) For $j = $i+1 To $EndLoop-1 Select Case StringInStr($DynamicFuncs[$j], "If") And StringInStr($DynamicFuncs[$j], "Return") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$j], "If") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$j], "If") Execute($DynamicFuncs[$j]) EndSelect Next WEnd Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return "Just finished logging some stuff with a loop in the middle!" EndFunc ;<===_DynFunc Be careful with that as it makes a giant file very fast... UserDefined.au3 _FileWriteLog($file, 'Logging state before loop start') $counter = 1 While $counter < 10 _FileWriteLog($file, "LoopCount = "&$counter) $counter = $counter+1 WEnd _FileWriteLog($file, 'Logging state after loops end') Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 21, 2008 Share Posted February 21, 2008 Yes and no.I have been able to execute a loop, just have not been able to stop it so far...This is getting really cool now but unfortunately I need the loops.... I hope you can finish it someday!! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Oldschool Posted February 22, 2008 Author Share Posted February 22, 2008 This is getting really cool now but unfortunately I need the loops.... I hope you can finish it someday!! I got it working, but the loop counter has to written a bit different in the user defined section...check this: expandcollapse popup#Include <File.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\UserDefined.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_DynFunc2()) Func _DynFunc2() Local $file = @ScriptDir & "\mylog.txt" Local $counter = 1 Local $EndLoop For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "While") For $c = $i To $DynamicFuncs[0] If StringInStr($DynamicFuncs[$c], "WEnd") Then $EndLoop = $c ExitLoop EndIf Next $var3 = StringRegExp($DynamicFuncs[$i], '(?i)While(.*)', 3) ;MsgBox(0,"", $var3[0], 1) While Execute($var3[0]) For $j = $i+1 To $EndLoop-1 ;MsgBox(0,"", $DynamicFuncs[$j], 1) Select Case StringInStr($DynamicFuncs[$j], "If") And StringInStr($DynamicFuncs[$j], "Return") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$j], "If") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case StringInStr($DynamicFuncs[$j], "$counter") And StringLen($DynamicFuncs[$j]) < 13 ;MsgBox(0,"", $DynamicFuncs[$j]) $counter = Execute($DynamicFuncs[$j]) Case 1 Execute($DynamicFuncs[$j]) EndSelect Next WEnd Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return "Just finished logging some stuff with a loop in the middle!" EndFunc ;<===_DynFunc UserDefined.au3 _FileWriteLog($file, 'Logging state before loop start') While $counter < 10 _FileWriteLog($file, "LoopCount = "&$counter) $counter+1 WEnd _FileWriteLog($file, 'Logging state after loops end') Produces this output in the log: 2008-02-22 11:17:04 : Logging state before loop start 2008-02-22 11:17:04 : LoopCount = 1 2008-02-22 11:17:04 : LoopCount = 2 2008-02-22 11:17:04 : LoopCount = 3 2008-02-22 11:17:04 : LoopCount = 4 2008-02-22 11:17:04 : LoopCount = 5 2008-02-22 11:17:04 : LoopCount = 6 2008-02-22 11:17:04 : LoopCount = 7 2008-02-22 11:17:04 : LoopCount = 8 2008-02-22 11:17:04 : LoopCount = 9 2008-02-22 11:17:04 : LoopCount = 10 2008-02-22 11:17:04 : Logging state after loops end Link to comment Share on other sites More sharing options...
ptrex Posted February 22, 2008 Share Posted February 22, 2008 @Oldschool Good to see that someone found use of my example AFTER 2 years. Regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Oldschool Posted February 22, 2008 Author Share Posted February 22, 2008 (edited) Good to see that someone found use of my example AFTER 2 years. Nice work there ptrex, better late then never right.ptrex is the godfather of dynamic func everyone.There could be like a cool story to go along with that:Once upon a time while struggling through the slums of AutoIt infancy, an automation madman by the name of ptrex birthed an fragile idea caller dynamic func. While growing up noone was nice to the newborn creature, and it stayed a recluse hiding in the depths of the example scripts forum. One day another madman by the name of Oldschool was introduced and befriended the reclusive beast. He decided to teach it to execute conditional statements....Cheers dude. Edited February 22, 2008 by Oldschool Link to comment Share on other sites More sharing options...
Oldschool Posted February 22, 2008 Author Share Posted February 22, 2008 Here is another rather unusual example of dynamic loop execution: expandcollapse popup#Include <File.au3> Global $DynamicFuncs If Not _FileReadToArray(@ScriptDir & "\UserDefined.au3", $DynamicFuncs) Then MsgBox(4096,"Error", " Error reading the formula ==>> error:" & @error) Exit EndIf MsgBox(0, "",_DynFunc2()) Func _DynFunc2() Local $file = @ScriptDir & "\mylog.txt" Local $EndLoop For $i = 1 To $DynamicFuncs[0] Select Case StringInStr($DynamicFuncs[$i], "While") For $c = $i To $DynamicFuncs[0] If StringInStr($DynamicFuncs[$c], "WEnd") Then $EndLoop = $c ExitLoop EndIf Next If StringInStr($DynamicFuncs[$i], "<") Then $var3 = StringRegExp($DynamicFuncs[$i], "\<(.*)", 3) If StringInStr($DynamicFuncs[$i], "<") Then $var5 = "< "&$var3[0] If StringInStr($DynamicFuncs[$i], ">") Then $var3 = StringRegExp($DynamicFuncs[$i], "\>(.*)", 3) If StringInStr($DynamicFuncs[$i], ">") Then $var5 = "> "&$var3[0] While Execute($counter&$var5) For $j = $i+1 To $EndLoop-1 Select Case StringInStr($DynamicFuncs[$j], "If") And StringInStr($DynamicFuncs[$j], "Return") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$j], "If") $var = StringRegExp($DynamicFuncs[$j], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$j], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case StringLeft($DynamicFuncs[$j], 1) = "$" And StringInStr($DynamicFuncs[$j], "+");And StringLen($DynamicFuncs[$j]) < 23 $var1 = StringRegExp($DynamicFuncs[$j], '\+(.*)', 3) Assign("counter", Execute($counter+$var1[0]), 0) Case StringLeft($DynamicFuncs[$j], 1) = "$" And StringInStr($DynamicFuncs[$j], "-");And StringLen($DynamicFuncs[$j]) < 23 ;And StringInStr($DynamicFuncs[$j], "=") $var1 = StringRegExp($DynamicFuncs[$j], '\-(.*)', 3) Assign("counter", Execute($counter-$var1[0]), 0) Case Not StringInStr($DynamicFuncs[$j], "If") Execute($DynamicFuncs[$j]) EndSelect Next WEnd Case StringInStr($DynamicFuncs[$i], "If") And StringInStr($DynamicFuncs[$i], "Return") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Return(.*)', 3) If Execute($var[0]) Then Return Execute($var1[0]) Case StringInStr($DynamicFuncs[$i], "If") $var = StringRegExp($DynamicFuncs[$i], '(?i)If(.*)Then', 3) $var1 = StringRegExp($DynamicFuncs[$i], '(?i)Then(.*)', 3) If Execute($var[0]) Then Execute($var1[0]) Case StringLeft($DynamicFuncs[$i], 8) = "$counter" And StringInStr($DynamicFuncs[$i], "=") And StringLen($DynamicFuncs[$i]) < 20 $var1 = StringRegExp($DynamicFuncs[$i], '(?i)= (.*)', 3) $var5 = $var1[0] Assign("counter", $var5, 0) Case StringLeft($DynamicFuncs[$i], 5) = "$file" And StringInStr($DynamicFuncs[$i], "=") ;And StringLen($DynamicFuncs[$i]) < 23 $var1 = StringRegExp($DynamicFuncs[$i], '(?i)=(.*)', 3) $var5 = $var1[0] Assign("file", $var5, 0) ;MsgBox(0, "File", $file) Case Not StringInStr($DynamicFuncs[$i], "If") Execute($DynamicFuncs[$i]) EndSelect Next Return "Just finished logging some stuff with a loop in the middle!" EndFunc ;<===_DynFuncoÝ÷ ÙK¬7wjíÜ¡×W®+^.8ÓMú~)^ßÒè§ËZµæÞ~Þ)²Ö«·x×Múr§µê So when you try to execute, you will get an undeclared variable error, unless you are compiled. But if you select "continue anyway" during the error, you will get the desired result anyways. No what is killing me here, is for some reason not declaring the $file variable does not work in the same manner... When trying to execute with $file undeclared, and UserDefined.au3 looking like this: $file = @ScriptDir & "\mylog.txt" _FileWriteLog($file, 'Logging state before loop start') $counter = 1 While $counter < 10 _FileWriteLog($file, "LoopCount = "&$counter) $counter = $counter+1 WEnd _FileWriteLog($file, 'Logging state after loops end') no log file gets created.... Link to comment Share on other sites More sharing options...
GoogleDude Posted January 12, 2009 Share Posted January 12, 2009 (edited) There could be like a cool story to go along with that:Once upon a time while struggling through the slums of AutoIt infancy, an automation madman by the name of ptrex birthed an fragile idea caller dynamic func. While growing up noone was nice to the newborn creature, and it stayed a recluse hiding in the depths of the example scripts forum. One day another madman by the name of Oldschool was introduced and befriended the reclusive beast. He decided to teach it to execute conditional statements....Cheers dude.LMFAO I Just though that was funny as hell. True but funny. Edited January 12, 2009 by GoogleDude Link to comment Share on other sites More sharing options...
Valuater Posted January 12, 2009 Share Posted January 12, 2009 SBC is not here anymore, they have been bought by AT&T LA California Link to comment Share on other sites More sharing options...
GoogleDude Posted January 12, 2009 Share Posted January 12, 2009 SBC is not here anymore, they have been bought by AT&T LA CaliforniaHere in Houston, TX it is ATT as well. My ISP Type is ATT-UVerse FTTN (Fiber To The Node). It used to be SBC back in the day but that was a long time ago. 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