Testing Strings
Posted: 16 Jul 2017, 22:43
loop, 5
{
WinActivate, ahk_class XLMAIN
Sleep 300
send, {Down}
sleep 300
Send, {LCtrl Down}c{LCtrl Up}
sleep 300
PPhone := clipboard
sleep 500
MsgBox, %PPhone%
sleep 500
If (PPhone = "000-000-0000")
{
MsgBox, Its Zero
}
Else
{
MsgBox, Its A Real Number
}
sleep 500
}
I am looking to test the PPhone variable that should contain a phone number to make sure that I am not going call out on a zero phone number. I have a spreadsheet that contains several phone numbers in xxx-xxx-xxxx format. If there is a real number or a zero number this always tells me that it is a real number. I'd also like to eventually check the PPhone variable to make sure its not 000-000-0000 or 999-999-9999 but I figured Id try to make the first one work first.
Any help would be appreciated. Thank You!
{
WinActivate, ahk_class XLMAIN
Sleep 300
send, {Down}
sleep 300
Send, {LCtrl Down}c{LCtrl Up}
sleep 300
PPhone := clipboard
sleep 500
MsgBox, %PPhone%
sleep 500
If (PPhone = "000-000-0000")
{
MsgBox, Its Zero
}
Else
{
MsgBox, Its A Real Number
}
sleep 500
}
I am looking to test the PPhone variable that should contain a phone number to make sure that I am not going call out on a zero phone number. I have a spreadsheet that contains several phone numbers in xxx-xxx-xxxx format. If there is a real number or a zero number this always tells me that it is a real number. I'd also like to eventually check the PPhone variable to make sure its not 000-000-0000 or 999-999-9999 but I figured Id try to make the first one work first.
Any help would be appreciated. Thank You!