Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8086

Профиль | Отправить PM | Цитировать


Цитата ErikPshat:
Это конечно можно проверить на практике, но пока это так, размышления и аналитическая деятельность. »
Проверяю:
AutoIt
Код: Выделить весь код
AutoItSetOption("MustDeclareVars", 1)

ConsoleWrite( _
	"Returns  0 if the strings are identical." & @CRLF & _
	"Returns  1 if the string pointed to by psz1 has a greater value than that pointed to by psz2." & @CRLF & _
	"Returns -1 if the string pointed to by psz1 has a lesser value than that pointed to by psz2."  & @CRLF & @CRLF _
)


ConsoleWrite("1    w/s 5   ==> " & String(_StrCmpLogicalW("1",    "5"  )) & @CRLF)
ConsoleWrite("1    w/s 5.0 ==> " & String(_StrCmpLogicalW("1",    "5.0")) & @CRLF)
ConsoleWrite("1.0  w/s 5   ==> " & String(_StrCmpLogicalW("1.0",  "5"  )) & @CRLF)
ConsoleWrite("1.0  w/s 5.0 ==> " & String(_StrCmpLogicalW("1.0",  "5.0")) & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite("10   w/s 5   ==> " & String(_StrCmpLogicalW("10",   "5"  )) & @CRLF)
ConsoleWrite("10   w/s 5.0 ==> " & String(_StrCmpLogicalW("10",   "5.0")) & @CRLF)
ConsoleWrite("10.0 w/s 5   ==> " & String(_StrCmpLogicalW("10.0", "5"  )) & @CRLF)
ConsoleWrite("10.0 w/s 5.0 ==> " & String(_StrCmpLogicalW("10.0", "5.0")) & @CRLF)

ConsoleWrite(@CRLF)

ConsoleWrite("10   w/s 10   ==> " & String(_StrCmpLogicalW("10",   "10"  )) & @CRLF)
ConsoleWrite("10   w/s 10.0 ==> " & String(_StrCmpLogicalW("10",   "10.0")) & @CRLF)
ConsoleWrite("10.0 w/s 10   ==> " & String(_StrCmpLogicalW("10.0", "10"  )) & @CRLF)
ConsoleWrite("10.0 w/s 10.0 ==> " & String(_StrCmpLogicalW("10.0", "10.0")) & @CRLF)

Exit(0)

Func _StrCmpLogicalW($s1, $s2)
	Return DllCall('shlwapi.dll', 'int', 'StrCmpLogicalW', 'wstr', $s1, 'wstr', $s2)[0]
EndFunc
Цитата:
Код: Выделить весь код
Returns  0 if the strings are identical.
Returns  1 if the string pointed to by psz1 has a greater value than that pointed to by psz2.
Returns -1 if the string pointed to by psz1 has a lesser value than that pointed to by psz2.

1    w/s 5   ==> -1
1    w/s 5.0 ==> -1
1.0  w/s 5   ==> -1
1.0  w/s 5.0 ==> -1

10   w/s 5   ==> 1
10   w/s 5.0 ==> 1
10.0 w/s 5   ==> 1
10.0 w/s 5.0 ==> 1

10   w/s 10   ==> 0
10   w/s 10.0 ==> -1
10.0 w/s 10   ==> 1
10.0 w/s 10.0 ==> 0

Отдельное внимание на последнюю группу.
Это сообщение посчитали полезным следующие участники:

Отправлено: 20:09, 23-01-2019 | #226