home bbs files messages ]

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

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

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

   Message 9,625 of 9,834   
   Craig to Jim Moseley   
   Re: Trapping for non "number"   
   26 Feb 09 17:22:54   
   
   From: craig.futterman@nospam.comcast.net   
      
   Jim, Steve and Tony   
   Thanks for your assistance.   
   What I didn't think of doing was starting with a Picture.   
   This refers to the number of pills the physician for each size pill   
   (Coumadin for anyone interested).   
   I created a new picture I called numbersOnly.   
   #[.5]   
   This allows the numbers 1 -9 and if you want to do a decimal, remember only   
   .5 (or 1/2 a pill), is allowed.   
   If the users wants 1.5 pills he will just hit the decimal place and it will   
   automatically put the .5 in. If he tries .3 it will make it .5 and if he   
   tries a "/", it will give a message at the bottom which says invalid   
   character and won't put anything in. Is it possible to intercept that   
   message so I can make it more noticeable?   
      
   Craig   
      
      
      
      
   "Jim Moseley"  wrote in message   
   news:49a6bd20$1@pnews.thedbcommunity.com...   
   >   
   > Craig,   
   >   
   >>I have a field in a table which is set as a number field.   
   >   
   > Assuming you mean that you have a form with the field, then you can check   
   > what is entered by the field's keyChar() method.  For example (untested of   
   > course):   
   >   
   >  method keyChar(var eventInfo KeyEvent)   
   >     curChar = eventInfo.char()   
   >     if curChar >= "0" and curChar <= "9" then   
   >     else   
   >        ; check for multiple '.'   
   >        if curChar = ".' then   
   >           oldVal = self.value   
   >           if oldVal.search(".") > 0 then   
   >              disableDefault   
   >              eventInfo.setErrorCode(canNotDepart)   
   >              msgStop("Error","Only one decimal allowed")   
   >              return   
   >           endif   
   >        else   
   >           disableDefault   
   >           eventInfo.setErrorCode(canNotDepart)   
   >           msgStop("Error","Invalid digit")   
   >           return   
   >        endif   
   >     endif   
   >     doDefault   
   >  endMethod   
      
   --- 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