ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:parseint

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
functions:parseint [2017/04/17 15:30] korshunfunctions:parseint [2017/04/17 15:31] korshun
Line 8: Line 8:
 Parses s as an integer in the specified base. If base is 0, base 10 is used by default and [[:Number prefixes]] are enabled. Supports signs. Parses s as an integer in the specified base. If base is 0, base 10 is used by default and [[:Number prefixes]] are enabled. Supports signs.
  
-Returns status and result. +Returns status and parsed number. Status is one of the following:
- +
-Status is one of the following:+
   * PARSENUMBER_SUCCESS -- number successfully parsed. r2 contains the result.   * PARSENUMBER_SUCCESS -- number successfully parsed. r2 contains the result.
   * PARSENUMBER_OVERFLOW -- the number is too big to fit into a variable. r2 contains [[constants:INT_MAX]] with the sign of the number.   * PARSENUMBER_OVERFLOW -- the number is too big to fit into a variable. r2 contains [[constants:INT_MAX]] with the sign of the number.
   * PARSENUMBER_BADFORMAT -- the number failed to parse. r2 is unchanged.   * PARSENUMBER_BADFORMAT -- the number failed to parse. r2 is unchanged.
  
-See [[:Number parsing]] for features and examples. 
functions/parseint.txt · Last modified: 2017/04/17 15:38 by korshun