Bluesmaster Posted December 21, 2013 Author Share Posted December 21, 2013 (edited) @JohnOne I thought a bit about your suggestion using objects and it turns out I have done you wrong: main() Func main($key = "") $oResult = test() test() ; the more calls from any other possible locations you make... test() ; ...the higher the number will be. ; So test() has permanent access to a "variable" in main() > mission accomplished! ConsoleWrite( "asynchronous result: " & $oResult.Item("") & @LF ) EndFunc Func test() Static $oResult if not( IsObj( $oResult ) ) Then $oResult = ObjCreate( "Scripting.Dictionary" ) $oResult.ADD("" , 1 ) return $oResult Else $cache = $oResult.Item("") $oResult.REMOVE("") $oResult.ADD("" , $cache + 1 ) EndIf EndFunc This works just well and does what I want. Maybe the dictionary is not the ultimate solution but in principle it is a solution to the original request. Thank you & merry christmas ps: if anyone knows a better object let me know please. ( What I mean by that is an object that direclty represents a variable so that no fcn-call like ".item( "" )" is needed ) Edited December 21, 2013 by Bluesmaster My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
trancexx Posted December 21, 2013 Share Posted December 21, 2013 (edited) I added new data type to AutoIt while I was developer, called Table. It's supercool thingy which unfortunatly I wasn't able to finish implementing. Instead new/old developer (red Jon) removed some details probably to hide it from users until he figures out what to do with it. Still with latest beta it's possible to do this (even though it was more correct before when IsTable function existed): main() Func main($key = "") test() ; 1 test() ; 2 test() ; 3 test() ; 4 ConsoleWrite("result: " & test() & @LF) ; prints 5 ConsoleWrite("result: " & test() & @LF) ; prints 6 EndFunc Func test() Local Static $x If Not (VarGetType($x) = "Table") Then Local $y[] $x = $y $x.elem = 0 EndIf $x.elem += 1 Return $x.elem EndFunc ...not that it has anything to do with your question, LOL. But this could have: main() Func main($key = "") $a = test() ; 1 test() ; 2 test() ; 3 test() ; 4 test() ; 5 test() ; 6 ConsoleWrite("result: " & $a.elem & @LF) ; prints 6 ;<- Aha! EndFunc Func test() Local Static $x If Not (VarGetType($x) = "Table") Then Local $y[] $x = $y $x.elem = 0 EndIf $x.elem += 1 Return $x EndFunc Edited December 21, 2013 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Bluesmaster Posted December 21, 2013 Author Share Posted December 21, 2013 (edited) Well this seems to work. But I am a bit concerned if this is not too experimental. I could not find any posting to this new data type and the story of its development sounds like an adventure So how can I be sure this feature will not be removed in the next release crashing all my dependend code? ( independend opinions welcome ) So one creates a "table" ( most languages do know this as struct or? ) by using: $myVar[] ...right? What is under the hood there that it behaves more like an object than an ordinary autoit-variable ( as shown in the example )? best regards Blues Edited December 21, 2013 by Bluesmaster My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
trancexx Posted December 21, 2013 Share Posted December 21, 2013 Well, Jon pretty much knows that Table type is awesome feature. He is also bit afraid not to hurt my feelings more by removing it (God almighty knows where he got that idea) and he's kind of lazy to work on it, besides he doesn't wan't to fuck up something else if he starts playing with the code. So, it's kind of status quo on that. Experimental features are made for experimenting. Experiment then, I say. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Bluesmaster Posted December 21, 2013 Author Share Posted December 21, 2013 He is also bit afraid not to hurt my feelings more by removing it ^^ thats cute. So lets experiment then. Thank you for introducing the new datatype to me. My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 21, 2013 Moderators Share Posted December 21, 2013 Bluesmaster,The Table datatype disclosed by trancexx is undocumented, not experimental, and therefore does not exist as far as official AutoIt development is concerned. So it could be removed without warning from any future release, there is absolutely no guarantee of it perfoming in any manner whatsoever, and there will certainly be no bug fixes or changes. You use it entirely at your own risk.Personally I think Tables could be a very useful addition to the language - but you need to appreciate the current position of this feature before getting dependent on it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Bluesmaster Posted December 21, 2013 Author Share Posted December 21, 2013 @Melba23 Thanks for that advice My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
JohnOne Posted December 22, 2013 Share Posted December 22, 2013 "red jon" AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 23, 2013 Moderators Share Posted December 23, 2013 Bluesmaster,And as I warned, the Table datatype is not in the 3.3.10.0 release. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted December 23, 2013 Share Posted December 23, 2013 I think you don't realize you have been outplayed. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Bluesmaster Posted December 25, 2013 Author Share Posted December 25, 2013 I think you don't realize you have been outplayed. In the risk of sounding a bit retarded: I do not understand what you mean by that. My UDF: [topic='156155']_shellExecuteHidden[/topic] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 25, 2013 Moderators Share Posted December 25, 2013 Bluesmaster,The comment was not directed at you, so it is not surprising that you do not understand it. I suggest you ignore the post completely, which is all it deserves. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
trancexx Posted December 25, 2013 Share Posted December 25, 2013 In the risk of sounding a bit retarded: I do not understand what you mean by that.You don't sound retarded, don't worry. The comment wasn't for you, otherwise I would've quoted your post.It was for one who understood it the second after reading it. One who thinks he can play with me, not realizing I'm step ahead. Fun way of making people do what you want them to, because sometimes they deserve just that. At the end AutoIt wins, so no sweat. ♡♡♡ . eMyvnE 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