Modify

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2611 closed Bug (Fixed)

end paramter in "StringFromASCIIArray" is wrong

Reported by: Indi2Go Owned by: Mat
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 Changed 11 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 11 years ago by Mat

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

Fixed by revision [9583] in version: 3.3.11.3

comment:3 Changed 11 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

Action
as closed The owner will remain Mat.
Author


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

 
Note: See TracTickets for help on using tickets.