NPN_Evaluate

  • Revision slug: NPN_Evaluate
  • Revision title: NPN_Evaluate
  • Revision id: 106418
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment newly imported

Revision Content

Summary

Evaluates a script in the scope of the specified NPObject.

Syntax

#include <npruntime.h>
 
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
                  NPVariant *result);

Parameters

The function has the following parameters:

<tt>npp</tt>
The NPP indicating which plugin instance's window to evaluate the script in.
<tt>script</tt>
The script to evaluate.
<tt>result</tt>
On return, contains the value returned by the script.

Returns

true if the script was evaluated successfully, otherwise false.

Description

The script is evaluated in the context of the window that the calling plugin instance (the <tt>npp</tt> argument) is loaded in.

Note: The caller must call NPN_ReleaseVariantValue() to release the returned value when it's no longer needed.

Revision Source

<p>
</p><p>
</p>
<h3 name="Summary">Summary</h3>
<p>Evaluates a script in the scope of the specified <code><a href="en/NPObject">NPObject</a></code>.
</p>
<h3 name="Syntax">Syntax</h3>
<pre>#include &lt;npruntime.h&gt;
 
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script,
                  NPVariant *result);
</pre>
<h3 name="Parameters">Parameters</h3>
<p>The function has the following parameters:
</p>
<dl><dt><tt>npp</tt>
</dt><dd>The <a href="en/NPP">NPP</a> indicating which plugin instance's window to evaluate the script in.
</dd><dt><tt>script</tt>
</dt><dd>The script to evaluate.
</dd><dt><tt>result</tt>
</dt><dd>On return, contains the value returned by the script.
</dd></dl>
<h3 name="Returns">Returns</h3>
<p><code>true</code> if the script was evaluated successfully, otherwise <code>false</code>.
</p>
<h3 name="Description">Description</h3>
<p>The script is evaluated in the context of the window that the calling plugin instance (the <tt>npp</tt> argument) is loaded in.
</p>
<div class="note"><b>Note:</b> The caller must call <code><a href="en/NPN_ReleaseVariantValue">NPN_ReleaseVariantValue()</a></code> to release the returned value when it's no longer needed.</div>
Revert to this revision