Modify ↓
#2611 closed Bug (Fixed)
end paramter in "StringFromASCIIArray" is wrong
| Reported by: | Indi2Go | Owned by: | Matt Diesel |
|---|---|---|---|
| Milestone: | 3.3.11.3 | Component: | Documentation |
| Version: | 3.3.10.2 | Severity: | None |
| Keywords: | Cc: |
Description
Hello,
the help file for the "end" paramter of the function "StringFromASCIIArray" is following:
end [optional] The 0-based index to end processing at (Default: UBound($aArray) - 1).
But this isn't the behaveiour of the function.
Following code shows the different:
Local $a = StringToASCIIArray("abcdef")
Local $s = StringFromASCIIArray($a)
ConsoleWrite("End=default: " & $s & @crlf)
$s = StringFromASCIIArray($a,0,Ubound($a)-1)
ConsoleWrite("End=(Ubound($a)-1): " & $s & @crlf)
I get follwoing results:
End=default: abcdef
End=(Ubound($a)-1): abcde
So the end paramter isn't '0' - based? (or the help file is wrong?)
/Indi2Go
Attachments (0)
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Milestone: | → 3.3.11.3 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [9583] in version: 3.3.11.3
comment:3 by , 12 years ago
| Component: | AutoIt → Documentation |
|---|
Note:
See TracTickets
for help on using tickets.

You are correct, it seems that the default is actually
UBound($a).As a result, this is not the index to end processing, it is the index+1. For example if you only want to get the third character (index 2) you would use
StringFromAsciiArray($a, 2, 3)I'll look at what the correct wording is and update the docs to match current behaviour. I'll then start a discussion as to whether the function should be changed.