Topic awaiting preservation: Boolean problem (maybe) |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: NZ |
posted 06-10-2003 07:12
Hi, guys. quote:
code: <html>
|
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-10-2003 14:58
When comparing values, you must use a double-equals sign! |
Paranoid (IV) Inmate From: NZ |
posted 06-10-2003 23:22
Hi, Slime. Good morning. code: <script type="text/javascript">
|
Bipolar (III) Inmate From: Cold Sweden |
posted 06-10-2003 23:43 |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-11-2003 00:43
Remember, ia Integer is a whole number, any non-whole number (that being any number with a percision greater that a whole number, something with decimal places) is a floating point number also know as a float. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-11-2003 03:43
Actually, I've been telling him the opposite, because the truth is, it doesn't *always* work that way. If you add two form values together, it will not add the numbers, but it will concatenate the strings. That's the primary time when it will mess up. Aside from that, using the ParseFloat or ParseInt functions are still a good idea, so that you know that if the user doesn't input a number, the code will cause an error rather than silently continuing and not letting you know that something went wrong. It's also important for beginning programmers to understand the distinction between strings which look like numbers ("32") and numbers themselves (32). |
Maniac (V) Inmate From: Brisbane, Australia |
posted 06-11-2003 03:52
quote:
|
Paranoid (IV) Inmate From: NZ |
posted 06-11-2003 04:13
Hi, guys. Many many thanks for your replies. |