Sign in to follow this  
Followers 0
Mechaflash

Save an argument to a variable

6 posts in this topic

#1 ·  Posted (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?

EDIT

The 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 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.”

 

Share this post


Link to post
Share on other sites



You could create a variable and then pass it on to the function.

E.G.

$MyVer1 = "Test"
$MyVer2 = "Hello World"
Msgbox(1,$MyVer1,$MyVer2)

Share this post


Link to post
Share on other sites

@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.”

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

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.”

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0