You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
558 B

name: duk_require_int
proto: |
duk_int_t duk_require_int(duk_context *ctx, duk_idx_t idx);
stack: |
[ ... val! ... ]
summary: |
<p>Like <code><a href="#duk_get_int">duk_get_int()</a></code>,
but throws an error if the value at <code>idx</code> is not a number
or if the index is invalid.</p>
<!--
<p>The number is coerced as for <code><a href="#duk_get_int">duk_get_int()</a></code>
with only numeric inputs allowed.</p>
-->
example: |
printf("int value: %ld\n", (long) duk_require_int(ctx, -3));
tags:
- stack
introduced: 1.0.0