Quote from luishp on February 3, 2021, 8:29 am@gaev has asked me to publish this script from him as the security system rejects it:
{NeoBook Function} Version=5.80 Language=VBScript Param=[%1]|Text|firstString Param=[%2]|Text|secondString Param=[%3]|Variable|result {End} intCompare = StrComp("[%1]","[%2]",0) ' MsgBox "[%1]" & " - " & "[%2]" & " - " & intCompare If intCompare = -1 Then compareResult = "isLessThan" End If If intCompare = 0 Then compareResult = "isEqual" End If If intCompare = 1 Then compareResult = "isGreaterThan" End If ' MsgBox compareResult publication.nbSetVar "[%3]", compareResultHe will add some comments soon.
Thanks!
@gaev has asked me to publish this script from him as the security system rejects it:
{NeoBook Function} Version=5.80 Language=VBScript Param=[%1]|Text|firstString Param=[%2]|Text|secondString Param=[%3]|Variable|result {End} intCompare = StrComp("[%1]","[%2]",0) ' MsgBox "[%1]" & " - " & "[%2]" & " - " & intCompare If intCompare = -1 Then compareResult = "isLessThan" End If If intCompare = 0 Then compareResult = "isEqual" End If If intCompare = 1 Then compareResult = "isGreaterThan" End If ' MsgBox compareResult publication.nbSetVar "[%3]", compareResult
He will add some comments soon.
Thanks!
Quote from Gaev on February 3, 2021, 6:58 pmThanks @luishp for loading the file on the forum.
If you want to Call this Function in any of your Publications, just save it in the VisualNEOWin Functions folder.
After that, any time you need case-sensitive compares, do something like this ...
SetVar "[strA]" "abcd" SetVar "[strB]" "ABCD" Call "CaseSensitiveIf" "[strA]" "[StrB]" "[resultVariable]" AlertBox "compareResult" "[strA][#13][resultVariable][#13][strB]"[resultVariable] will contain one of ...
isLessThan
isEqual
isGreaterThanHappy comparing !
Thanks @luishp for loading the file on the forum.
If you want to Call this Function in any of your Publications, just save it in the VisualNEOWin Functions folder.
After that, any time you need case-sensitive compares, do something like this ...
SetVar "[strA]" "abcd" SetVar "[strB]" "ABCD" Call "CaseSensitiveIf" "[strA]" "[StrB]" "[resultVariable]" AlertBox "compareResult" "[strA][#13][resultVariable][#13][strB]"
[resultVariable] will contain one of ...
isLessThan
isEqual
isGreaterThan
Happy comparing !
Quote from Reinier Maliepaard on March 21, 2021, 6:01 pmHi Gaev!
Thanks for your case-sensitive comparison script. I wonder why you use VBScript. Within VisualNeo Win the following code has the same result (or do I miss something?) Notice the use of the magical ! character that guarantees case-sensitive comparisons.
If "![str1]" "=" "![str2]"
AlertBox "Case-sensitive compare" "[str1] = [str2]"
Else
If "![str1]" ">" "![str2]"
AlertBox "Case-sensitive compare" "[str1] > [str2]"
Else
If "![str1]" "<" "![str2]"
AlertBox "Case-sensitive compare" "[str1] < [str2]"
EndIf
EndIf
EndIfBest regards,
Reinier
Hi Gaev!
Thanks for your case-sensitive comparison script. I wonder why you use VBScript. Within VisualNeo Win the following code has the same result (or do I miss something?) Notice the use of the magical ! character that guarantees case-sensitive comparisons.
If "![str1]" "=" "![str2]"
AlertBox "Case-sensitive compare" "[str1] = [str2]"
Else
If "![str1]" ">" "![str2]"
AlertBox "Case-sensitive compare" "[str1] > [str2]"
Else
If "![str1]" "<" "![str2]"
AlertBox "Case-sensitive compare" "[str1] < [str2]"
EndIf
EndIf
EndIf
Best regards,
Reinier
Quote from Gaev on March 22, 2021, 1:31 am@reinier
You are right ... the ! before the variables does the trick.
I offered it as a workaround after it was assumed by many (including me) that the If command had a defect (feature ?) that only did non-case-sensitive compares.
Now that I think about it, I believe that Dave posted the same solution on the NeoBook forum ... looks like I am having more of those senior moments :-(
Thanks for the reminder.
You are right ... the ! before the variables does the trick.
I offered it as a workaround after it was assumed by many (including me) that the If command had a defect (feature ?) that only did non-case-sensitive compares.
Now that I think about it, I believe that Dave posted the same solution on the NeoBook forum ... looks like I am having more of those senior moments :-(
Thanks for the reminder.