Core Function DllStructGetVars

From Sputnik Wiki
Revision as of 09:09, 29 November 2011 by UberFoX (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
DllStructGetVars( <dllstruct> )

Contents

Description

Create an array of all items and their array size with total byte size

Parameters

dllstruct

The DLLStruct to use.

Return Value

Success - Returns the array (hashmap name,key) with keys as the variable names with value as a 2 element array where first is the ubound of the array and second is total bytes used by the item.

Failure - Returns empty array.

Remarks

None

Example

$a	= DllStructCreate( "int var1;ubyte var2;int test[700];uint var3;char var4[128]");
 
$vlist = DLLStructGetVars($a);
foreach($vlist as $Name <=> $vData)
{
	List( $UBound, $Bytes) = $vData;
	if($UBound)
		println("DLLStruct item '$Name' has array size of '$UBound' and uses '$Bytes' byte(s) of ram");
	else
		println("DLLStruct item '$Name' is not an array and uses '$Bytes' byte(s) of ram");
}
 
// A more cool way
println("DLLStruct item 'test' has size of '" .  DLLStructGetVars($a)["test"][0] . "'");
println("DLLStruct item 'test' uses '" .  DLLStructGetVars($a)["test"][1] . "' byte(s) of ram");
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox