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
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, "/", "?"
[ ] // return the altered string
[ ] return s</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
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.
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.
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.
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,
Silverter - A guru was once a beginner