Core Function PTRRead

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
Line 14: Line 14:
  
 
==== type ====
 
==== type ====
 +
 
The type of data to read
 
The type of data to read
 
<pre>
 
<pre>
Line 30: Line 31:
 
d double
 
d double
 
</pre>
 
</pre>
 +
 +
==== offset ====
 +
 +
Offset to add to the pointer.
  
 
=== Return Value ===
 
=== Return Value ===

Revision as of 20:48, 14 August 2013

PTRRead( <ptr>, <type>, <offset> )

Contents

Description

Read data from a memory pointer optionally starting from a given index.

Parameters

ptr

The pointer to use.

type

The type of data to read

[TYPE]		[WHAT IT IS]
c		ASCII char
C		UNICODE char
b		unsigned byte
B		signed byte
s		signed int16
i		signed int32
l		signed int64
S		unsigned int16
I		unsigned int32
L		unsigned int64
f		float
d		double

offset

Offset to add to the pointer.

Return Value

Success: Returns the value requested or -1 if fail.

Failure: Returns 0.

Remarks

None.

Example

$PTR = Alloc(300);
 
PTRWrite($PTR, "f", 0, 133.77);
PTRWrite($PTR, "l", 4, 777);
PTRWrite($PTR, "i", 12, 1221);
 
Println( PTRRead($PTR, "f", 0) );
Println( PTRRead($PTR, "l", 4) );
Println( PTRRead($PTR, "i", 12) );
 
Free($PTR);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox