IF THEN statement question-

Results 1 to 3 of 3

Thread: IF THEN statement question-

  1. #1
    Kentium Guest

    Default IF THEN statement question-

    I&#039;ve got some if then statements-<BR><BR>if whatever &#060;&#062; "" then<BR> somevar = "checked"<BR> anothervar ="&#060;img src=/images/checkmark.gif"<BR>else<BR> somevar = ""<BR> anothervar = ""<BR>end if<BR><BR>first question- if somevar and anothervar don&#039;t have a value when this IF statement runs, and the condition is false, is it really necessary to set the vars = "". If they&#039;re already nothing, and the condition is false, don&#039;t they stay nothing?<BR><BR>thanks.

  2. #2
    Join Date
    Dec 1969

    Default No, it's not necessary <nm>


  3. #3
    Join Date
    Dec 1969

    Default Mild disagreement...

    In your ELSE code you are *not* setting those variables to "nothing". You are setting them to zero length strings. Which are QUITE DIFFERENT than the VBS keyword nothing (which I don&#039;t really think you meant) and also different than an uninitialized variable (which is Empty, incidentally).<BR><BR>Granted, most code won&#039;t notice the difference between an empty variable and one that contains a zero-length string, *but* I can very easily construct code that would barf on an empty variable.<BR><BR>SO...<BR><BR>A better answer is the one that is the most common answer to all software questions: "It depends."<BR><BR>

Posting Permissions

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