Core Function isVarClient

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> isVarClient( $variable ) </pre> === Description === Check if a variable holds a Client object from Connect(). === Parameters === ==== variable ==== The variable to che...")
 
(Example)
 
(One intermediate revision 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 = SSConnect("127.0.0.1", 5500, "test");
 
println( "Is it?: " . isVarClient($var1) );
 
println( "Is it?: " . isVarClient($var1) );
 +
// Alternative
 +
println( $var1 is Client  );
 +
// Alternative
 +
println( $var1 ~~ Client  );
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 10:50, 29 August 2013

isVarClient( $variable )

Contents

Description

Check if a variable holds a Client object from Connect().

Parameters

variable

The variable to check.

Return Value

Success: Returns true.

Failure: Returns false.

Remarks

None.

Example

$var1 = SSConnect("127.0.0.1", 5500, "test");
println( "Is it?: " . isVarClient($var1) );
// Alternative
println( $var1 is Client  );
// Alternative
println( $var1 ~~ Client  );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox