Modify

Opened 9 years ago

Closed 9 years ago

#1370 closed Bug (Fixed)

StringInStr()

Reported by: anonymous Owned by: Valik
Milestone: 3.3.3.0 Component: AutoIt
Version: 3.3.2.0 Severity: None
Keywords: StringInStr crash Xp Cc:

Description

;; StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] )
;; @Error 0 - Normal operation, 1 - Invalid "start" or "occurence" parameter given.

;~ $result = StringInStr($string, $substr, $case, 1, 1000) ;; --- 0, [0.0] ... (Invalid "start?, no @error.)
;~ $result = StringInStr($string, $substr, $case, 1, 1000000) ;; --- 0, [0.0] ... (Invalid "start?, no @error.)

$result = StringInStr($string, $substr, $case, -1, 1000000) ;; --- ... (autoit crash)
;~ $result = StringInStr($string, $substr, $case, -1, 1000) ;; --- 123, [0.0] ... (result not zero)(Invalid "start?, no @error.)

Local $err = @error, $ext = @extended
ConsoleWrite('$result = ' & $result & ', [' & $err & ',' & $ext & ']' & @CRLF)

;; XP.Pro.Sp3, Au3.3.3.2.0.

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by Valik

These two are returning the correct result:

;~ $result = StringInStr($string, $substr, $case, 1, 1000) ;; --- 0, [0.0] ... (Invalid "start?, no @error.)
;~ $result = StringInStr($string, $substr, $case, 1, 1000000) ;; --- 0, [0.0] ... (Invalid "start?, no @error.)

An invalid start parameter is one that is <= 0:

StringInStr("abc", "d", 1, 1, 0)
ConsoleWrite(@error & @CRLF)

The crashing should not happen and will be fixed.

comment:2 Changed 9 years ago by Valik

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

Fixed by revision [5484] in version: 3.3.3.0

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 Valik.
Author


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

 
Note: See TracTickets for help on using tickets.