Jump to content

Reading Text


Recommended Posts

Hi all

I am reading text into a variable then comparing it with a string, and I want it to ignore the case.

I have looked everywhere I can think of but I cant find how to achieve this.

Thanks for looking

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Link to comment
Share on other sites

Hi all

I am reading text into a variable then comparing it with a string, and I want it to ignore the case.

I have looked everywhere I can think of but I cant find how to achieve this.

Thanks for looking

String compares in AutoIt are normally not case sensitive unless the "==" operator is used:
$sA = "Variable"
$sB = "VARIABLE"
$sMsg = $sA & " = " & $sB & " is " & ($sA = $sB) & @CRLF
$sMsg &= $sA & " == " & $sB & " is " & ($sA == $sB) & @CRLF
MsgBox(64, "Results", $sMsg)

In some functions, such as _StringInStr(), an input parameter is used to flag case sensitivity.

muttley

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi and thanks.

I am using e RegRead create a variable and then comparing it with a text string and it was only working intermittently. I looked at several regestries and found that the only difference was the case in some instances. I have amended the script to read:

$read = RegRead("HKEY_CURRENT_USER\Software\Winscribe\General\", "WinscribeURL")

$read1 = RegRead("HKEY_LOCAL_MACHINE\Software\Winscribe\General\", "WinscribeURL")

$readl = StringLower($read)

If $read = "" Then Exit

If $readl = "http://rpras008/winscribe/" Or $readl = "http://rpras008/winscribe" Then

and this seems to be working so far. Bizzarre I know but there you are.

Thanks for the reply

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...