mozilla

Compare Revisions

Working with data

Change Revisions

Revision 98263:

Revision 98263 by Sheppy on

Revision 98264:

Revision 98264 by Sheppy on

Title:
Working with data
Working with data
Slug:
Mozilla/js-ctypes/Using_js-ctypes/Working_with_data
Mozilla/js-ctypes/Using_js-ctypes/Working_with_data
Tags:
JavaScript, js-ctypes
JavaScript, js-ctypes
Content:

Revision 98263
Revision 98264
n122      <em>More information coming soon.</em>n122      You can work around this by serializing these values using 
 >the <a href="/en/js-ctypes/js-ctypes_reference/CData#toString()" 
 >title="en/js-ctypes/js-ctypes reference/CData#toString()"><code>t
 >oString()</code></a>&nbsp;method and comparing using the resultin
 >g string.
tt124    <p>
125      See <a href="/en/js-ces_rtypes/js-ctypeference/CType/Pointe
 >rType#Determining_if_two_pointers_are_equal" title="en/js-ces rty
 >pes/js-ctypeference/CType/PointerType#Determining if two pointers
 > are equal">Determining if two pointers are equal</a> for an exam
 >ple of how this works when comparing pointers.
126    </p>
127    <h3>
128      Example:&nbsp;Checking the value of an integer
129    </h3>
130    <p>
131      If, for example, you need to see if the value of an integer
 > is 5, you can do so like this:
132    </p>
133    <pre class="brush: js">
134var t = ctypes.int32_t(5);
135 
136if (t.toString() == "ctypes.int32_t(5)") {
137  // it's 5
138
139</pre>

Back to History