Link to home
Start Free TrialLog in
Avatar of conrad2010
conrad2010

asked on

C# what does "out" do here? internal static bool IsValidGUID(String s, out Guid value)

I know this function just verifies the content of string "s"... what does (and how does it work) "out Guid value" do here?

How is this function used?

internal static bool IsValidGUID(String s, out Guid value)
        {
            if (s == null || s.Length != 36)
            {
                value = Guid.Empty;
                return false;
            }
}
Avatar of p_davis
p_davis

whatever is calling this method, im assuming, reacts when the guid value is empty after the return of the method
Avatar of conrad2010

ASKER

correct, just don't know what the "out" value does for the calling method
can you show the method that  calls it?
if (cGeneral.IsValidGUID(this.txtUID.Text, out newGuid))
        sDUID = this.txtUID.Text;
    else
        MessageBox.Show("Not a valid UID"); return;
with cGeneral.IsValidGUID being the function I posted originally
no what is calling IsValidGUID.. on its own i can only guess what the out value is used for... whatever code passes the parameter to it is what i need to see
and the code around it
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
perfect answer and example!