Jump to content
Nareshm

stringlen(Clipget()) Not working

Recommended Posts

Nareshm
$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
water

What does function Clipdata do?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Nareshm
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
Simpel

Hi.

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

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

Conrad


SciTE4AutoIt = 3.7.3.0   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
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water
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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Simpel

Nope. I'm on vacation without AutoIt.

You're right. It should be:

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

Conrad 


SciTE4AutoIt = 3.7.3.0   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
Nareshm

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
water

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 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

What had caused your problem?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Nareshm
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

×