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,467 of 10,840   
   B to Erwin Bormans   
   Re: Convert text to double   
   03 May 05 22:42:14   
   
   From: nospam@nospam.com   
      
   Erwin Bormans schreef:   
   > Hello   
   >   
   > I want to convert a value in a text propertie to a double.   
   >   
   > I can use CDbl(grid1.text) for this, but the problem is that some text   
   > properties are empty and when they are the code give errors.   
   >   
   > Is there a way to convert text to double, but if the text is empty he just   
   > returns zero?   
   >   
   > Kind Regards   
   > Erwin   
   >   
   >   
      
   Cdbl(Val(grid1.text)), but watch out it will give zero for an empty   
   string. Otherwise use if ..then   
      
   if lenb(grid1.text) <> 0 then   
      CDbl(grid1.text)   
   end if   
      
   B.   
      
   --- 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