Search the Community
Showing results for tags 'idea'.
-
Hello friends , I was working on my project today and got a wild idea with Switch..EndSwitch statements, it looks like this: #include <MsgBoxConstants.au3> $iWildInteger = 10 Switch $iWildInteger Case 1 MsgBox($MB_OK, "AutoIt Forums", "The value of $iWildInteger is " & 1 & '.') Case 2, Else MsgBox($MB_OK, "AutoIt Forums", "The value of $iWildInteger is " & 2 & ' or else.') EndSwitchA case with Else and another value... I tried it but It didn't work , I think its great to have a feature like this so that I don't have to have a separate case for it Please note that this is *NOT* a feature request , This is a poll for opinion on this feature (before making a feature request in the BT ), Vote wisely, TD
- 26 replies
-
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[0], Data[1]" 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[0] you have this, and if you call Code[1] 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[0]) MsgBox($MB_ICONINFORMATION, 'Yay', 'This is the same function, you call Subcode[1] and both MsgBox will show.') #EndRegion Subcode 'And now, In Code[2], we write a function that use the Subcode function' MsgBox($MB_ICONINFORMATION, Subcode[0] 'I can access the Local region data') Subcode[1] ; 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.