SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Dec 2007
    Posts
    206
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    pattern validation in a string

    Hi, Here i strucked with a problem.I have to validate a error message.when i give invalid inputs it displays error message and if i give valid inputs it will show message like "Replenish information through creditcard is saved for Account 3000217. but here in this message the nuemeric part is changing based on the account. my target is if above message dispalyed it shoud exit

    If var="Replenish information through creditcard is saved for Account 3000217. " Then
    Reporter.ReportEvent 0,"TC","Replenshed successfully"
    Else
    Reporter.ReportEvent 0,"TC",var
    End if
    Here 3000217 value is changing

    -------------------------------
    Moderator's Editing comment: please follow the forum guidelines are provide a specific summary decription of your question in the postings Subject line--rather than a generic non-specific phrase like "validation"

  2. #2
    Member
    Join Date
    Jul 2005
    Location
    Melbourne, Australia
    Posts
    453
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: validation

    Check out the VB string function left. Rather than doing the compare on the whole string, only do the compare for part of the string. Or, if you want to use the account number and you know the account number compare against a string you build using concatenation ie If var="Replenish ... Account " & accountNumber.

  3. #3
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: validation

    Check out the vbScript built-in function, inStr() and vbScript's robust support for Regular Expressions. Both are covered in on-line help.

  4. #4
    Member
    Join Date
    Dec 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: validation


    If (instr(var,"Replenish")>0) Then
    Reporter.ReportEvent 0,"TC","Replenshed successfully"
    exit run
    Else
    Reporter.ReportEvent 0,"TC",var
    End if


    Murugesh

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 01:33 AM.

Copyright BetaSoft Inc.