No announcement yet.

Boolean NULL value test?

This topic is closed.
  • Filter
  • Time
  • Show
Clear All
new posts

  • Boolean NULL value test?

    Hello, I looked for this in the FAQ and everywhere else, and couldn't find it, so......

    My project checks an INI file when my autorun starts. It stored the values from the keys in the INI in variables. All variables default to FALSE.

    I also have three text boxes on the screen. I want the text boxes to appear ONLY if the key exists, or if the key is non-null. But an empty key value passes any boolean test i can think of, and it overrides the default too! Here's an example:

    contents of myini.ini

    Remember the text boxes should only appear for valid keys.
    TEXT1 shows
    TEXT2 shows
    TEXT3 shows (but shouldn't, default is FALSE)
    TEXT4 does not show (no key at all, default value holds)

    Is there a way I can check if a key has a NULL value?


  • #2
    Re: Boolean NULL value test?

    I'm not quite sure what the problem is, what happens when you try to read in a blank value from an INI file? Your variable get set to “nothing” correct? Why does an empty Key Value pass any Boolean condition that you can think of?

    I tested this on my machine, and all that happens is the variable that I used to read information in from Key3 got set to "nothing". So I simply used a Boolean condition that "%INIVar% <> " and everything worked properly.

    So what you should do is make sure that each TEXT BOX has two Boolean conditions:

    1) "%INIVar% <> FALSE"
    2) "%INIVar <> "

    (Note: you do not have to type anything in the Value B field, simply leave it blank and this will work)

    MSI Factory The Next Generation Intelligent Setup Builder