Modify

Opened 3 months ago

Last modified 3 months ago

#3790 assigned Bug

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

Reported by: Chimp Owned by: Jpm
Milestone: 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 (1)

comment:1 Changed 3 months 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 !!!

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 assigned The owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.