Jump to content

Recommended Posts

Okay, i've been wondering how you would get a function to return its value to a variabel specified by the user...

Like: here is my UDF

Func SpriteCreate($Image, $Width, $Height, $StartX, $StartY)

GUICtrlCreatePic($Image, $StartX, $StartY, $Width, $Height)

EndFunc

I would want the user to be able to do:

$SpriteBox = SpriteCreate($Image, $Width, $Height, $StartX, $StartY)

so $SpriteBox would be the variable for GUICtrlCreatePic...

sorry, it is kind of hard for me to explain. any ideas people?

Link to post
Share on other sites

you mean something like?

Func SpriteCreate($Image, $Width, $Height, $StartX, $StartY)
    Local $controlID
    $controlID = GUICtrlCreatePic($Image, $StartX, $StartY, $Width, $Height)
    If $controlID Then
        Return $controlID
    Else
        SetError(1)
        Return 0
    EndIf
EndFunc
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...