Core Function StringToPTR

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> StringToPTR( <type>, <string> ) </pre> === Description === Allocates memory for the string and writes the string to that memory and returns the pointer for that memory. ...")
 
m (1 revision)
 
(3 intermediate revisions by one user not shown)
Line 17: Line 17:
 
2 AUTO
 
2 AUTO
 
</pre>
 
</pre>
 +
 +
==== string ====
 +
The string to use.
  
 
=== Return Value ===
 
=== Return Value ===
Line 22: Line 25:
 
Success: Returns the pointer.
 
Success: Returns the pointer.
  
Failure: Returns 0.  
+
Failure: Returns @PTRZero.
  
 
=== Remarks ===
 
=== Remarks ===

Latest revision as of 12:37, 14 June 2015

StringToPTR( <type>, <string> )

Contents

Description

Allocates memory for the string and writes the string to that memory and returns the pointer for that memory.

Parameters

type

What type of string copy into the allocated memory to do

[TYPE]		[WHAT IT IS]
0		ASCII
1		UNICODE
2		AUTO

string

The string to use.

Return Value

Success: Returns the pointer.

Failure: Returns @PTRZero.

Remarks

None.

Example

$PTR_ASCII = StringToPTR(0, "Hello World");
$PTR_UNICODE = StringToPTR(1, "Hello World 2");
$PTR_AUTO = StringToPTR(2, "Hello World 3");
 
Println(   PTRToString(0, $PTR_ASCII)   ); // ASCII
Println(   PTRToString(1, $PTR_UNICODE)   ); // UNICODE
//Println(   PTRToString(2, $PTR_BSTR)   ); // BSTR
Println(   PTRToString(3, $PTR_AUTO)   ); // AUTO
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox