SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jun 2001
    Location
    Milford
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    String Verification

    I get a string and need to verify it. The problem is that it has a date in it that always changes. And depending on how the PC was setup could give me different results. ie XX/XX/XXXX or X/X/XX.

    So i need to help to figure out a way to verify a date is in the string and then Verify the first part of the string. Here is what the string looks like.

    User: UniqueAccountName Modified password : 6/2/03

    Any suggestions?

    Thanks!

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Verification

    Try something like this...
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[ ] // convert whacks to question marks so Silk will read them
    [+] string RemoveWhacks(string sConvert)
    [ ]
    [ ] // substitue ? for / in the passed in string.
    [ ] string s = StrTran(sConvert, &quot;/&quot;, &quot;?&quot
    [ ]
    [ ] // return the altered string
    [ ] return s</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  3. #3
    Junior Member
    Join Date
    Jun 2001
    Location
    Milford
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Verification

    I thought of that as well but I need to verify the text. And the date will change daily. I need to remove everything after the date and verify it.


    Steve

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Location
    Milford
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Verification

    Sorry let me clarify that. I need to verify the date exists, then strip off The date and anything after it, and then verify the text.


    Thanks,
    Steve

  5. #5
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Verification

    Originally posted by rafiki47:
    Sorry let me clarify that. I need to verify the date exists, then strip off The date and anything after it, and then verify the text.
    <font size="2" face="Verdana, Arial, Helvetica">MatchStr() can be used to determine if the input contains a date.

    GetField() can be used to break the input into words along space boundaries - each of which can then tested in a loop using MatchStr() again to see if one of the expected date structures appear.

    Silk's DATE and DATETIME data types can likely provide the rest.


    John

  6. #6
    Member
    Join Date
    Nov 2000
    Location
    Ulm, DE
    Posts
    82
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: String Verification

    Another suggestion would be to get the different fileds as suggested above and convert your dates in the format YYMMDD and compared them as integers, (after converting the strings to integers with Val ()). Hope this helps,

    regards,
    Silverter - A guru was once a beginner

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 02:05 AM.

Copyright BetaSoft Inc.