Hello,I am working on a small script that will allow users to automatically add printers to their NT 4.0 W/S
I have for the last three days been tearing my hair out over the piece of code below. I have checked a number of example scripts and as far as I can see the IF statement looks fine.
Basically the user will be presented with a menu of printers they wish to add. They then select the number of the printer they wish to add.
This is the gets $sel statement.
The variable $new_count is equal to the number of printers to choose from, in this case 12.
So the logic should be if the choice is greater than or equal to 0 or less than or equal to 12, gosub the add_printer routine.
This actually works fine, the problem is if you enter a negative number, or a number greater than twelve. It still gosubs add_printer routine, does not matter what number, it tries to add a non-existant printer.
I have tried every permutation possible, I think. Being fairly new to Kix, I'm I missing something blindingly obvious.
I have the latest version 3.62 and I'm using v2.0 of the Visual editor.
? " "
color c+/n
? "Please Select Printer you Wish to Add : "
gets $sel
IF $sel >= 0 OR $sel <= $new_count
? $sel
gosub add_printer
Else
? $sel
? "Invalid Choice - Please Select 0 to " + $new_count
sleep 2
endif