Modify ↓
Opened 2 years ago
Last modified 2 years ago
#3976 assigned Bug
StringRegExp can create invalid arrays (just like StringSplit)
| Reported by: | jchd18 | Owned by: | Jon |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.16.1 | Severity: | None |
| Keywords: | Cc: |
Description (last modified by )
The issue raised by ticket #3972 applies as well to StringRegExp, for the very same reason.
Global $s = ' ' For $i = 0 To 24 Step 1 $s = $s & ";" & $s Next ConsoleWrite(StringLen($s) & @CRLF) ; String is now 33,554,432 symbols long with 33,554,431 delimiters Global $a = StringRegExp($s, '(.[^;]*);?', 3) ; Also works with flag 4. Global $err = @error, $ext = @extended ConsoleWrite('@error = ' & $err & @CRLF) ; @error is not set, because delimiters were indeed found ConsoleWrite('@extended = ' & $ext & @CRLF) ; Just to be sure it is also 0. ConsoleWrite('VarGetType = ' & VarGetType($a) & @CRLF) ; It is an array ConsoleWrite('UBound = ' & UBound($a) & @CRLF) ; UBound works (propably because Array-Metadata are set before the array is filled, I don't know the code so this is guesswork) ConsoleWrite($a[0] & @CRLF) ; This will fail -> Array variable has incorrect number of subscripts
Attachments (0)
Change History (2)
comment:1 by , 2 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 2 years ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
Note:
See TracTickets
for help on using tickets.

Fix sent to Jon