IF...THEN question?
MichelB
Posts: 154
Hi all, I've a little problem with the attached code, when I enter a wrong number DEBUG tell me that the number is wrong but the program continues. I'm not sure that my IF...THEN is correct, I don't find an identical example in BASIC Stamp manual. An other problem, but it concerns Tracy Allen, when I enter a negative N and a positive D I obtain a positive result. Thank you in advance for your help. MichelB
Note: attached file has been deleted.
Post Edited (MichelB) : 8/4/2009 3:45:16 PM GMT
Note: attached file has been deleted.
Post Edited (MichelB) : 8/4/2009 3:45:16 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy
Please try with the attached code.
P.S.: Program runs well when "numerator:",·"denominator:" are removed and when OR between IF...THEN are replaced by AND, except if N is out of range, try with the attached code Rev.
Post Edited (MichelB) : 8/4/2009 7:58:00 AM GMT
For the DEC operator the values are 0 to 65535.
Any value outside this interval will automatically be truncated to a value inside the interval.
If you want to have this type of error checking, you have to do some fancy coding using DEBUGIN with strings. I'm not sure you want to go that route?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't worry. Be happy