You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Language/Functions/Communication/Stream/streamParseInt.adoc
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -14,11 +14,10 @@ title: Stream.parseInt()
14
14
15
15
[float]
16
16
=== Description
17
-
`parseInt()` returns the first valid (long) integer number from the current position. Initial characters that are not integers (or the minus sign) are skipped.
17
+
`parseInt()` returns the first valid (long) integer number from the current position.
18
18
19
19
In particular:
20
20
21
-
* Initial characters that are not digits or a minus sign, are skipped; +
22
21
* Parsing stops when no characters have been read for a configurable time-out value, or a non-digit is read; +
23
22
* If no valid digits were read when the time-out (see link:../streamsettimeout[Stream.setTimeout()]) occurs, 0 is returned;
24
23
@@ -28,17 +27,21 @@ This function is part of the Stream class, and can be called by any class that i
28
27
29
28
[float]
30
29
=== Syntax
31
-
`stream.parseInt(list)`
30
+
`stream.parseInt()` +
31
+
`stream.parseInt(lookahead)` +
32
+
`stream.parseInt(lookahead, ignore)`
32
33
33
-
`stream.parseInt(''list', char skipchar')`
34
34
35
35
[float]
36
36
=== Parameters
37
-
`stream` : an instance of a class that inherits from Stream.
37
+
`stream` : an instance of a class that inherits from Stream. +
38
+
`lookahead`: the mode used to look ahead in the stream for an integer. Allowed data types: `LookaheadMode`. Allowed `lookahead` values:
38
39
39
-
`list` : the stream to check for ints (`char`)
40
+
* `SKIP_ALL`: all characters other than digits or a minus sign are ignored when scanning the stream for an integer. This is the default mode.
41
+
* `SKIP_NONE`: Nothing is skipped, and the stream is not touched unless the first waiting character is valid.
42
+
* `SKIP_WHITESPACE`: Only tabs, spaces, line feeds, and carriage returns are skipped.
40
43
41
-
`skipChar`: used to skip the indicated char in the search. Used for example to skip thousands divider.
44
+
`ignore`: used to skip the indicated char in the search. Used for example to skip thousands divider. Allowed data types: `char`
0 commit comments