Search the Community
Showing results for tags 'programming'.
Found 5 results
Hi everyone! I'm using AutoIt for several years now and I really get the hang of it! I'm quite the curious OCD perfectionist kind of guy, so I can't help wondering.. what would be the best way to program stuff for the compiler / interpreter / scripting engine? We're talking about the inner workings of the AutoIt's core here, and how to give it as less friction as possible but also take care of the machine running the script. For example, Imagine a script where we would constantly have to assign a Boolean value to a variable: ; A: local $bool = false $bool = true $bool = true $bool = false ; B: local $bool = false check(true) check(true) check(false) func check($b) if $bool = $b then return $bool = $b endfunc In this case, would it be better to just overwrite (A) the variable or first check if we really need to (B)? What would be best for the computers memory if it had to do this for a year non stop? Another example, imagine you're writing a function with an if statement. If you would look under the hood of AutoIt, what would be the best way to give your computer as less work / code nesting stack filling as possible: ; A: func decide($b_Input) if $b_Input then ;do something else ;do something else endif endfunc ; B: func decide($b_Input) if $b_Input then ;do something return endif ;do something else endfunc Last one for now: ; A: while 1 ; do stuff wend ; B: while true ; do stuff wend Isn't AutoIt taking an extra step in converting 1 to a Boolean in example (A)? Or is it the other way around and does the (B) way make AutoIt first convert a keyword (true or false) to a numerical value (0 or 1). I think this kinda detail stuff is quite interesting, makes me wonder how AutoIt converts and runs our code. What are your opinions on this topic? Any coders who know more about the inner workings of AutoIt? Any people like me who ask themselves similar questions (with examples)? Let me know! 😉
1,488 downloadsDbug is graphical debugger for AutoIt. Project started by @Heron in 2009 and now supported by @asdf8 and @valdemar1977. Features Debug the complete script or just parts of it Display run status (line number of currently executed function) GUI default always-on-top in the upper right corner for comfortable debugging WM_NOTIFY and WM_COMMAND hook to prevent interference with possible message handlers Display scope, type and value of variables, expressions, macro's and constants (global AND function local) Execute commands in an immediate window. Can be expressions, functions and assignments Detailed display of array, struct and object variables Dynamic display of variable value in the source code (under cursor) Array table viewer with ability to view the sub-arrays, the correct handling of macro @Error, @Extended and other changes OEM and ANSI console output Conditional breakpoints Saving settings and debugging state and much more... How to use Extract from downloaded archive _Dbug.au3 to your Autoit include dir Add #include <_Dbug.au3> in to your code and run code Before compile or buid comment or remove #include <_Dbug.au3> from your code
Ok, hi guys. First, let me say that this is just a concept, an idea, I don't know enough programming to do that but I had this weird idea for a programming language. I don't know if this also exists. I was playing with AutoIt, and then the #region gave me a weird idea, what I call "Regional Programming". Imagine this, scripting with regions instead of variables and function, a mix of both. A region can contain values or orders, for example (I'm gonna use AutoIt-like scripting): Global #Region Data "Think of this as a big variable where you can put everything in everyline and it can have multiple kind of values, if you don't close this string you can still write on everyline" "Now this is another value, as concept, it might act like Arrays, but I'm not sure of this. Data, Data" 141234234 "It can also contain other kind of values." "Yes, I like space-sensitive scripting" #EndRegion Data You can declare all region as global, or local, and you can declare regions in regions, maybe this can be a little hard to read... You can also put code in regions: Global #Region Code "Ok, this is a value, you can mix both, so if you call Code you have this, and if you call Code you have a function" MsgBox($MB_ICONINFORMATION, 'This is like a function', 'You can call it like a function') "This kind of script remains me someway to Lua" #EndRegion Code And, finally, local region. As I said before, this can be space-sensitive, so you can write a lot of lines of code, and when you put a space the code is over. The last example: Global #Region Code 'First region' Local #Region Subcode 'A region in a region. Regionception.' MsgBox($MB_ICONINFORMATION, 'I can access the Global region data', $Code) MsgBox($MB_ICONINFORMATION, 'Yay', 'This is the same function, you call Subcode and both MsgBox will show.') #EndRegion Subcode 'And now, In Code, we write a function that use the Subcode function' MsgBox($MB_ICONINFORMATION, Subcode 'I can access the Local region data') Subcode ; Remember, same function while not spaced. #Endregion Code Well, trying to write this was hard, and maybe a little hard to understand, but that was just an idea, and ideas are for being shared.
Im relative new to this awesome script language and every day Im mindblowed but what things I discover and didn't know about the au3 syntax but I have some questions : #1. What is ByRef and what it does/why to use it/where to use it #2. Is this really really true that the first character after the $ sign in the variable name means the type of the variable ??? :shocked: ( Like $iVar = int and $sVar = char types from C ? ) What about if I declare $Random instead ? If the above is true, then why all my created programs are working with random names without the correct specific type declared ? Like $pink = 5 + 5 does works despite the 'p' representing the pointer type ! #3. Why I need to unregister things or close any handles like DllClose after a DllOpen OR _GDIPlus_Shutdown() after my script exists ? #4. And last but not the least why this : #include <Misc.au3> ;Global declarations ;... Func () Func() ; the code Endfunc and not this instead : #include <Misc.au3> ;Global declarations ;... ; the code Will there be any problems whatsoever if the last variant ?
Right now, this is only a concept, to see if it's worth doing it. The idea is: build a script to build a programming language, with a predefined syntax, but with a configurable list of commands. Please tell if you'd like/want/don't want it. EDIT: I posted it here because, if it's worth making it, I will post it in this thread.