Core Function EvalSet

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> EvalSet( <evalObject>, <name>, <value> ) </pre> === Description === Set a variable inside an Eval Object. === Parameters === ==== evalObject ==== An Eval Object creat...")
 
Line 34: Line 34:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
 +
// Create an Eval Object
 +
my $EvalSpk = EvalCreate();
 +
 
// Create and get the variable
 
// Create and get the variable
 
if(  EvalSet($EvalSpk, "Test", 1221)  )
 
if(  EvalSet($EvalSpk, "Test", 1221)  )

Revision as of 12:54, 1 August 2014

EvalSet( <evalObject>, <name>, <value> )

Contents

Description

Set a variable inside an Eval Object.

Parameters

evalObject

An Eval Object created from EvalCreate().

name

The name of the variable you wish to assign.

data

The data you wish to assign to the variable.

Return Value

Success: Returns true.

Failure: Returns false if unable to create/assign the variable.

Remarks

This sets the variable in the GLOBAL scope of the Eval Object.

Example

// Create an Eval Object
my $EvalSpk = EvalCreate();
 
// Create and get the variable
if(  EvalSet($EvalSpk, "Test", 1221)   )
{
	println("Test: " . EvalGet($EvalSpk, "Test"));
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox