Core Function isVarSocket

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> isVarSocket( $variable ) </pre> === Description === Check if a variable holds a Socket object. === Parameters === ==== variable ==== The variable to check. === Return...")
 
m (1 revision)
 
(2 intermediate revisions by one user not shown)
Line 15: Line 15:
 
=== Return Value ===
 
=== Return Value ===
  
Success: Returns 1.
+
Success: Returns true.
  
Failure: Returns 0.
+
Failure: Returns false.
  
 
=== Remarks ===
 
=== Remarks ===
Line 26: Line 26:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
$var1 = "check me";
+
$var1 = SocketCreate("Stream", "TCP");
 
println( "Is it?: " . isVarSocket($var1) );
 
println( "Is it?: " . isVarSocket($var1) );
 +
// Alternative
 +
println( $var1 is Socket  );
 +
// Alternative
 +
println( $var1 ~~ Socket  );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 12:37, 14 June 2015

isVarSocket( $variable )

Contents

Description

Check if a variable holds a Socket object.

Parameters

variable

The variable to check.

Return Value

Success: Returns true.

Failure: Returns false.

Remarks

None.

Example

$var1 = SocketCreate("Stream", "TCP");
println( "Is it?: " . isVarSocket($var1) );
// Alternative
println( $var1 is Socket  );
// Alternative
println( $var1 ~~ Socket  );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox