Sign in to follow this  
Followers 0
PantZ4

How make the function return?

7 posts in this topic

How do I make the function return a GUI window?

Eg.

My Function takes width and heigth and returns a GUI windiow

_Function($GUIWidth,$GUIHeigth)

But where does I place the return value?

Thank you :whistle:

Share this post


Link to post
Share on other sites



How do I make the function return a GUI window?

Eg.

My Function takes width and heigth and returns a GUI windiow

_Function($GUIWidth,$GUIHeigth)

But where does I place the return value?

Thank you :whistle:

Not quite sure where the problem lies... This what you mean?

#include <guiconstants.au3>

$gui = Return_A_GUI(400,380)
$ok = GUICtrlCreateButton("OK",10,10)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $ok Then Exit
WEnd
Exit

Func Return_A_GUI($w,$h)
    $guiToReturn = GUICreate("test gui",$w,$h)
    Return $guiToReturn
EndFunc

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Not quite sure where the problem lies... This what you mean?

#include <guiconstants.au3>

$gui = Return_A_GUI(400,380)
$ok = GUICtrlCreateButton("OK",10,10)
GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $ok Then Exit
WEnd
Exit

Func Return_A_GUI($w,$h)
    $guiToReturn = GUICreate("test gui",$w,$h)
    Return $guiToReturn
EndFunc
Thank you :whistle:.

(I'm just used to BJASS. Funtion(takes something, returns something)

Share this post


Link to post
Share on other sites

Thank you :whistle:.

(I'm just used to BJASS. Funtion(takes something, returns something)

... Doesn't this function take something and return something too?


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

... Doesn't this function take something and return something too?

Yes but in BJASS (Warcraft 3) you declare the vaule your function return, in the function name too.

Example:

_MyFunction(takes $GUIWidth, $GUIHeigth returns $GUIWindow)

Edited by Mr. Zero

Share this post


Link to post
Share on other sites

Yes but in BJASS (Warcraft 3) you declare the vaule your function return, in the function name too.

Quess I won't be learning to code WC3 functions anytime soon :whistle:

So anyway, problem solved now?


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Quess I won't be learning to code WC3 functions anytime soon :whistle:

So anyway, problem solved now?

Yes thank you :P

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