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;
}
}
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;
}
}
whatever is calling this method, im assuming, reacts when the guid value is empty after the return of the method
ASKER
correct, just don't know what the "out" value does for the calling method
can you show the method that calls it?
ASKER
if (cGeneral.IsValidGUID(this .txtUID.Te xt, out newGuid))
sDUID = this.txtUID.Text;
else
MessageBox.Show("Not a valid UID"); return;
sDUID = this.txtUID.Text;
else
MessageBox.Show("Not a valid UID"); return;
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect answer and example!