Modify

Opened 16 years ago

Closed 16 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 by Valik, 16 years ago

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 by Valik, 16 years ago

Milestone: 3.3.3.0
Owner: set to Valik
Resolution: Fixed
Status: newclosed

Fixed by revision [5484] in version: 3.3.3.0

Modify Ticket

Action
as closed The owner will remain Valik.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.