ezeio2:scriptref:strval

Differences

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

Link to this comparison view

Next revision
Previous revision
ezeio2:scriptref:strval [2019-06-15 21:23] – created andrehezeio2:scriptref:strval [2024-02-05 23:20] (current) andreh
Line 1: Line 1:
-===== Script reference ====== +==== strval ====
- +
-==== strval( string[], index ) ====+
  
 Find the numeric value of a string. Find the numeric value of a string.
Line 7: Line 5:
 === Description === === Description ===
  
-<code>strval( const string[], index=0 )</code>+<code>strval( const string[], index=0, limit=15 )</code>
  
-strval will evaluate all digits starting at the index position until it encounters a non-digit.+strval will evaluate all digits starting at the index position until it encounters a non-digit or evaluated ''limit'' characters whichever comes first.
  
 === Parameters === === Parameters ===
Line 15: Line 13:
 | ''string'' | The buffer to be evaluated | | ''string'' | The buffer to be evaluated |
 | ''index'' | The offset in the buffer to start looking for a number. | | ''index'' | The offset in the buffer to start looking for a number. |
 +| ''limit'' | The max number of digits to evaluate, starting after ''index''. |
  
 === Return value === === Return value ===
Line 32: Line 31:
 </code> </code>
  
- +<wrap hi>NOTE: The ''limit'' parameter requires firmware 24020101 or newer.</wrap>
- +
  • ezeio2/scriptref/strval.1560633781.txt.gz
  • Last modified: 2019-06-15 21:23
  • by andreh