Код:
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
|