make "" = "0" (eval/ str?)

Results 1 to 2 of 2

Thread: make "" = "0" (eval/ str?)

  1. #1
    Join Date
    Dec 1969

    Default make "" = "0" (eval/ str?)

    I want to be able to turn a "" into a "0" (in VB)<BR>assuming X is empty:<BR>if x="" then x= val(x) &#060;- val isn&#039t a VB method?<BR>x=str(x) &#060;- nor is str - to translate into a string<BR><BR>what would the correct syntax be? Eval, Int?<BR><BR>many thanks.

  2. #2
    alphageek Guest

    Default Strings

    Hello:<BR><BR> To convert a string into an integer, you can use CInt(var), CSng(var), CDbl(var), or CLng(var). However, these are not going to change a null string to a zero. You may want to either disallow null strings or use an if:<BR><BR>if x="" then x="0"<BR><BR>Good Luck!<BR><BR>~Ben

Posting Permissions

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