Nareshm

stringlen(Clipget()) Not working

12 posts in this topic

#1 ·  Posted (edited)

$sdata = Clipget()
$bothtext = 12
$bothtext = 14

;some code here
 if stringlen($sdata) = $bothtext then
;some code here
endif
;some code here

i tried it but not working

Edited by Nareshm
ClipData was mistakenly written as clipdata instead

Share this post


Link to post
Share on other sites



#2 ·  Posted

What does function Clipdata do?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

24 minutes ago, water said:

What does function Clipdata do?

if stringlen($sData) = (12 or 14 Digits) then
               ControlSend(":: Aadhar Number Entry ::", "", "[NAME:txtAadharNumber]", "^v")
               ControlClick(":: Aadhar  Number Entry ::", "", "[NAME:btnNext]")
            Else
               MsgBox(48,"ADHAR NUMBER ERROR - E102", "Adhar Card Number Not Copied,  Please Copy Adhar Number and Paste into box or enter manually.")
WinWait("Members - Biometric Verification/Check Utility")
WinActivate("Members - Biometric Verification/Check Utility")

sorry @water

ClipData was mistakenly written as clipdata instead
 

;check If copied text 12 or 14 digits

Edited by Nareshm

Share this post


Link to post
Share on other sites

#4 ·  Posted

Hi.

I think you should strip 'Digits'. It should look like:

If StringLen($sData) = (12 Or 14) Then

Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#5 ·  Posted

Something like this:

if stringlen($sData) = 12 or stringlen($sData) = 14 then
               ControlSend(":: Aadhar Number Entry ::", "", "[NAME:txtAadharNumber]", "^v")
               ControlClick(":: Aadhar  Number Entry ::", "", "[NAME:btnNext]")
            Else
               MsgBox(48,"ADHAR NUMBER ERROR - E102", "Adhar Card Number Not Copied,  Please Copy Adhar Number and Paste into box or enter manually.")
WinWait("Members - Biometric Verification/Check Utility")
WinActivate("Members - Biometric Verification/Check Utility")

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

1 minute ago, Simpel said:

If StringLen($sData) = (12 Or 14) Then

Did you test this?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

Nope. I'm on vacation without AutoIt.

You're right. It should be:

If StringLen($sData) = 12 Or StringLen($sData) = 14 Then

Conrad 


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#8 ·  Posted

Thanks @Simpel and @water
But

If StringLen($sData) = 12 Or StringLen($sData) = 14 Then

is not working
Some time my adhar card (clipget) format is 123412341234 (is working)

and some time 1234 1234 1234 (include space, not working)

Please Help

Share this post


Link to post
Share on other sites

#9 ·  Posted

Add a MsgBox to your script:

MsgBox(0, "Length", StringLen($sData))
If StringLen($sData) = 12 Or StringLen($sData) = 14 Then

 


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

What had caused your problem?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#12 ·  Posted

4 minutes ago, water said:

What had caused your problem?

@water

I was copying cell from excel file And the length of excel cell was 16 (14 + 2 was shown in extra) which I found out from your msgbox script

 

Share this post


Link to post
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