Core Function GetVarObjType

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> GetVarObjType( $variable ) </pre> === Description === Get the common object type of a variable (If it is an object) === Parameters === ==== variable ==== The variable ...")
 
Line 54: Line 54:
 
}
 
}
 
break;
 
break;
case 10: // Object (Unknown object that doesnt have its own type in Sputnik yet most likely)
+
case 10: // Object (Unknown object that doesn't have its own type in Sputnik yet most likely)
 
{
 
{
 
}
 
}

Revision as of 20:27, 4 December 2011

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:

[CODE]		[TYPE]		[@MACRO]
0		CLASS		@typeCLASS
1		FILE		@typeFILE
2		BINARY		@typeBINARY
3		GUI		@typeGUI
4		GUIObject	@typeGUIObject
5		ASSEMBLY	@typeASSEMBLY
6		METHOD		@typeMETHOD
7		MYSQL		@typeMYSQL
8		MYSQLDATA	@typeMYSQLDATA
9		DLLSTRUCT	@typeDLLSTRUCT
10		OBJECT		@typeOBJECT
11		SERVER		@typeSERVER
12		CLIENT		@typeCLIENT

Remarks

None.

Example

Checking as numeric

$a = "My value";
 
if( GetVarObjType($a) == 11 ) // Server
{
}
 
switch( GetVarObjType($a) )
{
	case 9: // DLLStruct
	{
	}
	break;
	case 10: // Object (Unknown object that doesn't have its own type in Sputnik yet most likely)
	{
	}
	break;
}

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