home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,931 of 10,840   
   Rick Rothstein [MVP - Visual Basic] to All   
   Re: viusal basic input validation intege   
   28 Feb 06 23:22:53   
   
   XPost: comp.programming   
   From: rickNOSPAMnews@NOSPAMcomcast.net   
      
   > Is not:  Not Value Like "*[!0-9]*" ... redundant?   
      
   No, it is not redundant. You can't test directly like this   
      
         Value Like "*[!0-9]*"   
      
   because that would match any **single** digit, no matter where it is located   
   and no matter what the other characters are (digits or not). The only way to   
   handle this, as you found out, is with the "double negative" approach. For a   
   string to be composed of all digits, no one of them can be a non-digit. So   
   we check for that non-digit-ness. And if it is False, then the string is   
   composed of only digits characters. But we don't want to return False   
   through the function, so we NOT the expression to turn False into True for   
   return through the function. As for syntax, the exclamation mark within the   
   squared brackets says "match all characters **except** for those that   
   follow".   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca