Modify

Opened 3 years ago

Closed 3 years ago

#3790 closed Bug (Fixed)

CharW() >= 64968 compares with "" as True

Reported by: Chimp Owned by: Jon
Milestone: 3.3.15.4 Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

CharW() >= 64968 compares with "" as True. I think it shouldn't
Here a snippet to show the problem.

For $i = 64960 To 64975
        ConsoleWrite('chrw(' & $i & ') = "" ? --> ' & (ChrW($i) = '') & @TAB & @error & @CRLF)
Next

it results as:
chrw(64960) = "" ? --> False 0
chrw(64961) = "" ? --> False 0
chrw(64962) = "" ? --> False 0
chrw(64963) = "" ? --> False 0
chrw(64964) = "" ? --> False 0
chrw(64965) = "" ? --> False 0
chrw(64966) = "" ? --> False 0
chrw(64967) = "" ? --> False 0
chrw(64968) = "" ? --> True 0
chrw(64969) = "" ? --> True 0
chrw(64970) = "" ? --> True 0
chrw(64971) = "" ? --> True 0
chrw(64972) = "" ? --> True 0
chrw(64973) = "" ? --> True 0
chrw(64974) = "" ? --> True 0
chrw(64975) = "" ? --> True 0

P.S.
(a workaround) As answered in the post at the following link in the forum, the problem doesn't arise if we compare using == instead of =
https://www.autoitscript.com/forum/topic/204398-why-charw-64967-compares-as-an-empty-string/?do=findComment&comment=1468690

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by Jpm

  • Owner set to Jpm
  • Status changed from new to assigned

Fix sent to Jon
the comparison was stop at the first null string
now if strings have different size they are taken in account to differentiate the strings insensitive case comparison.
BTW the insansitive string comparison always stop at the first nul char. Be carefull !!!

comment:2 Changed 3 years ago by Jon

  • Milestone set to 3.3.15.4
  • Owner changed from Jpm to Jon
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed by revision [12560] in version: 3.3.15.4

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


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

 
Note: See TracTickets for help on using tickets.