Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2611 closed Bug (Fixed)

end paramter in "StringFromASCIIArray" is wrong

Reported by: Indi2Go Owned by: Mat
Milestone: Component: Documentation
Version: Severity: None
Keywords: Cc:


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?)


Attachments (0)

Change History (3)

comment:1 Changed 10 years ago by Mat

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.

comment:2 Changed 10 years ago by Mat

  • Milestone set to
  • Owner set to Mat
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [9583] in version:

comment:3 Changed 10 years ago by Mat

  • Component changed from AutoIt to Documentation

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Mat.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.