Thanks Aaron: I did not know this. Kevin Huber
On 10/15/10, Ron Parker <[email protected]> wrote: > > It's best to not know this, or at least to code like you don't know > this. You should never need to compare a boolean variable to any > constant, and you should never ever do anything involving the numeric > value of a boolean variable. If you do need a constant for some other > reason, use vbTrue and vbFalse. > > Otherwise, someday, when you least expect it, there'll be a new version > of the interpreter and it'll change. > > (This has happened to me. It wasn't VBScript, but it was a BASIC > interpreter.) > > On 10/15/2010 4:22 PM, Aaron Smith wrote: >> In VBScript, True is -1, False is 0. >> >> Aaron >> >> On 10/15/2010 4:14 PM, Kevin Huber wrote: >>> Hi Aaron: >>> I was thinking that if c was either true or false, then c is boolean, >>> which would suggest that: >>> c = 1 is equivalent to >>> c = true >>> and c = 0 is equivalent to >>> c = false >>> >>> >>> On 10/15/10, Aaron Smith<[email protected]> wrote: >>>> On 10/15/2010 3:35 PM, Kevin Huber wrote: >>>>> I'm confused. Is the if..then..else example that you gave supposed to >>>>> be >>>>> equivalent to the line: >>>>> c = (a = b)? >>>> That's correct. >>>>> I thought that c could = either 1 or 0, which would mean that if a = b >>>>> then c = 1 else c = 0 >>>> None of the variables in my example where ever assigned any values, so >>>> I'm not sure where you're pulling 1 and 0 from. The shorthand c = (a = >>>> b) is the same as the long winded if example. If a and b are equal, then >>>> the value of that evaluation is stored in c. If they are not, then the >>>> value of that evaluation is stored in c. Either way, the value being >>>> assigned to c is not any kind of direct mathematical computation on a >>>> and b, but rather a comparison of their values. That's what the >>>> parenthesis are doing. The result is a report on whether or not (if then >>>> else) they're equal. >>>> >>>> Aaron >>>> >>>> -- >>>> Aaron Smith >>>> Product Support Specialist * Web Development >>>> GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825 >>>> 260-489-3671 * gwmicro.com >>>> >>>> To insure that you receive proper support, please include all past >>>> correspondence (where applicable), and any relevant information >>>> pertinent to your situation when submitting a problem report to the GW >>>> Micro Technical Support Team. >>>> >>> c = false> >>> >> >> -- >> Aaron Smith >> Product Support Specialist * Web Development >> GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825 >> 260-489-3671 * gwmicro.com >> >> To insure that you receive proper support, please include all past >> correspondence (where applicable), and any relevant information >> pertinent to your situation when submitting a problem report to the GW >> Micro Technical Support Team. > >
