Core Function GetVarObjType

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Return Value)
 
(4 intermediate revisions by one user not shown)
Line 28: Line 28:
 
GUIObject @typeGUIObject
 
GUIObject @typeGUIObject
 
SOCKET @typeSOCKET
 
SOCKET @typeSOCKET
STREAM @typeSTREAM
 
 
FUNCTION @typeFUNC
 
FUNCTION @typeFUNC
 
LINQ @typeLINQ
 
LINQ @typeLINQ
CHARPTR @typeCHARPTR
 
.NET Object @typeDOTNETOBJ
 
 
ERROR @typeERR
 
ERROR @typeERR
 
</pre>
 
</pre>
Line 41: Line 38:
  
 
=== Example ===
 
=== Example ===
 
Checking as numeric
 
 
<syntaxhighlight lang="sputnik">
 
$a = "My value";
 
 
if( GetVarObjType($a) == 7 ) // Server
 
{
 
}
 
 
switch( GetVarObjType($a) )
 
{
 
case 5: // DLLStruct
 
{
 
}
 
break;
 
case 6: // Object (Unknown object that doesn't have its own type in Sputnik yet most likely)
 
{
 
}
 
break;
 
}
 
</syntaxhighlight>
 
  
 
Checking using @ Macro of the numeric
 
Checking using @ Macro of the numeric

Latest revision as of 19:16, 18 September 2015

GetVarObjType( $variable )

Contents

Description

Get the common object type of a variable (If it is an object)

Parameters

variable

The variable to check.

Return Value

Returns the common object type a variable as a numeric value types are:

[TYPE]		[@MACRO]
CLASS		@typeCLASS
FILE		@typeFILE
MYSQL		@typeMYSQL
MYSQLDATA	@typeMYSQLDATA
DLLSTRUCT	@typeDLLSTRUCT
OBJECT		@typeOBJ
SERVER		@typeSERVER
CLIENT		@typeCLIENT
GUIObject	@typeGUIObject
SOCKET		@typeSOCKET
FUNCTION	@typeFUNC
LINQ		@typeLINQ
ERROR		@typeERR

Remarks

None.

Example

Checking using @ Macro of the numeric

$a = "My value";
 
if( GetVarObjType($a) == @typeCLIENT )
{
}
 
switch( GetVarObjType($a) )
{
	case @typeCLASS:
	{
	}
	break;
	case @typeMYSQLDATA:
	{
	}
	break;
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox