quote:
Haven't checked the UDF's but I always learned that a compare between numbers can only be done when the value contains only pure numbers so a compare between 10.10.0.1 and 10.10.4.5 would be unreliable.
A common misunderstanding. If you look at my first post you will see that I say "a simple string compare will work"

We are not comparing the numbers in the IP address, we are comparing the entire strings. Now, the strings happen to comprise numeric characters, "." and space characters but they are still strings.

You will only get a problem where the strings are of different length, because the comparison is left-to-right. The string returned by @IPADDRESSx has the octets space filled to justify them, which means that a string compare will work.

As an example, here is a string compare of IP addresses. The first one using the IP address in the form returned by @IPADDRESSx will work, the second one using non-justified values will fail:

code:
$sIPAddress=" 10.  0.  0. 50"
If $sIPAddress > " 10. 0. 0. 9"
"Test 1 works :)" ?
Else
"Test 1 fails :(" ?
EndIf

$sIPAddress="10.0.0.50"
If $sIPAddress > "10.0.0.9"
"Test 2 works :)" ?
Else
"Test 2 fails :(" ?
EndIf

[edit]
As a further example you can also compare dates in the same way, so the following examples will work fine:
code:
If @DATE > "2004/00/00" AND @DATE < "2004/99/99"
"The year is 2004!" ?
EndIf

$sExpires="2010/08/11"
If @DATE >= $sExpires
"Sorry, the license has expired." ?
EndIf

[/edit]

[ 10. September 2003, 13:21: Message edited by: Richard H. ]