Mechaflash Posted February 16, 2012 Share Posted February 16, 2012 (edited) Is there a way to take an argument from a function and turn it into a variable?For example, if I create a msgbox(1,"Test","Hello World!") and I wanted to take the first argument and store it into a variable, would it be possible to without changing the function itself? Or would I be better of just creating a new function with msgbox() code and tweaking it?EDITThe reason I ask is because I'm using where it resizes the GUI in its function. I wanted to find a way to extract the argument from the function instead of creating a variable for the function so that I could just do GUICreate(), and whatever arguments gets passed for its x/y and size, I could easily retrieve and reuse in other calculations without having to declare it first as a variable. Edited February 16, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2012 Share Posted February 16, 2012 You could create a variable and then pass it on to the function.E.G.$MyVer1 = "Test" $MyVer2 = "Hello World" Msgbox(1,$MyVer1,$MyVer2) Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 16, 2012 Share Posted February 16, 2012 While 1 Sleep(10) $variable = InputBox("Test","Input Something!") If not @error then ExitLoop WEnd Msgbox(0,"Test",$variable) Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Mechaflash Posted February 16, 2012 Author Share Posted February 16, 2012 @Blue_Drache bah! you're saving the output of the function to a variable, not its argument (even tho the argument is the output... it's different). And I was just thinking... I could probably do the GUICreate... then just use *GetPos on the window to get the parameters I want Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 16, 2012 Share Posted February 16, 2012 (edited) Saving the output of a function as a variable is the only way to go about what you're asking, unless you totally rewrite the MsgBox() function. Further more ... what your asking for makes absolutely no sense and I can see no honest practical use for it. Edited February 16, 2012 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Mechaflash Posted February 20, 2012 Author Share Posted February 20, 2012 Saving the output of a function as a variable is the only way to go about what you're asking, unless you totally rewrite the MsgBox() function.Further more ... what your asking for makes absolutely no sense and I can see no honest practical use for it.The idea behind it was to grab the value based on what the programmer entered for an expanding box , to perform some math with it for one of Melba's custom AU3s. Just something to process behind the scenes. But I believe Melba is already working on his AU3 to make it do what I was trying to make it do. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” 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