No announcement yet.

Misbehaving If Then statement.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Misbehaving If Then statement.

    Hi all,

    I have written this script to automate the install of UltraVNC during logon, I still have it in a testbed situation.

    Basically it works perfectly if it runs on Windows XP Professional. But for some oddball and unknown reason, an If Not statement is not returning the same results.

    The misbehaving line of code is:

    If Not blnFoundService Then

    When it gets to the fault line, the value of blnFoundService is False (or 0 for the die hards) - (I traced the value and it is definitely false). So, when I put the Not in, its meant to return True (or 1) and do whatever is in the If Then section - which it doesn't do as it treats it as false for some unknown reason.

    Anybody got some advice of what is happening and how to fix it?

    [Edit: Ooops - okay - problem resolved. The one test which set the boolean variable worked correctly. God a problem elsewhere when running under Windows 200, but first need some research on that one)
    Last edited by JamesNesbitt; 10th October 2005, 06:39. Reason: Problem resolved