NumberTesting$ = STR$(Number)
IF NOT INSTR(".", NumberTesting$) THEN NumberTesting$ = NumberTesting + ".0000"
While LEN(NumberTesting)-INSTR(".", NumberTesting$) < 4
Let NumberTesting$ = NumberTesting$ + "0"
WEND
Other than the fact that you left the dollar sign off of NumberTesting$ twice, and that the code is a little verbose, it looks like it should get the job done.
*****
moneo wrote:Watch out, the timer resets at midnight.
*****
Do you just go around my posts looking for errors? My internet computer doesn't have QBASIC because it can't run it right. I am only running these through PQBC-BASIC (my head), which is not always correct
Anyway, I fixed the NumberTesting$ and put my $'s on correctly.
PQBC wrote:.....
Do you just go around my posts looking for errors? My internet computer doesn't have QBASIC because it can't run it right. I am only running these through PQBC-BASIC (my head), which is not always correct .....
Please don't take it personal, PQBC. When a member posts some code, if I understand it, I always check it out for possible problems. Most of the time, I actually compile and test it. If I find any errors, I feel an obligation to point them out so that someone doesn't just insert the code into his program and have problems.
In your case, since you're posting code right off the top of your head, now that we know, we will take your code with "a grain of salt"; that is, we'll consider the idea or intent more than the actual code. Too bad you have to work in this fashion. When do you think you'll get QBasic working?
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
moneo wrote:When a member posts some code, if I understand it, I always check it out for possible problems.
moneo wrote:5) The PRODUCT will contain as many decimal places as the numbers determine. If the IPNUM had 2 decimals, then 2 + 1 of the .9 can give you a maximum of 3 decimal places in the PRODUCT.
Michael Calkins wrote:All caps does make text harder to read, but you would expect that MS-DOS programmers like us would be used to that. For example: file names in DOS are usually all caps, as are license agreements and some documentation for MS-DOS programs. All caps is no reason to flame, and absolutely not an indication of stupidity, anymore than all lowercase is.
Regards,
Michael
Long live MS-DOS! Long may it reign!!
What about those of us who spent our last days of QB using Notepad?
Just messin (although I really did use Notepad for my last QB projects) but I see your point.
Douth thou typeth like this my good sir knight?
(Add "proper" old english letters and phonetics as you please..)
Typing in all caps is a step back in "writing evolution" (call it whatever) where you move from the current, modern, highly expression rich form, to ancient, sterile writing.
There is a reason we use case, period, comma, exclamationmark, etc..
While I agree that you don't have to follow every single grammar rule 100% writing in all caps, makes you seem underly educated, and downright stupid.
Lately (read: the last 10 years) writing in all caps on the internet, or in emals, have been considered shouting.
I would slap anyone coming up to me shouting questions.
I slap anyone coming up to me shouting questions.
Also, just because you poor old people can't adapt, does not mean we have to adapt to you.
I demand you all learn swedish, I'm used to swedish, and as such, you must adapt and accept it.
Should we all be that silly? No.
Besides, if it was all lowrcase, I wouldnt care one bit about it. So, why not just change from upper->lower, is it that hard for you to adapt? Are you that snowed in on your old deprecated, outdated routines?
And yes, this post is pretty much a bashing of people defending themselves with: "But I'm used to it"
Don't get me wrong, I respect you for your knowledge moneo, but really.. Just because people do it, doesent mean it's right, or proper. Nor does it mean it's ok just because you're used to it.
Lisa, 11, is used to being raped by her father, as she's been since she was 7. Guess that's ok then?
moneo wrote:When a member posts some code, if I understand it, I always check it out for possible problems.
moneo wrote:5) The PRODUCT will contain as many decimal places as the numbers determine. If the IPNUM had 2 decimals, then 2 + 1 of the .9 can give you a maximum of 3 decimal places in the PRODUCT.
No, because:
1.1/2.9 Does not equal 2 decimals. Besides, if you go by the math rules, then you always use the number with the LEAST decimals as the highest accuracy, thus: 1.1/2.987+1.53 = 1.9
Not: 1.898262 (Which you would get by following your rule, of adding the decimals together)
Ofcourse, if you mean addition and subtraction.. but as you said: PRODUCT, which is only used when multiplying or dividing.. well..
Sorry Z!re, but I have been referring to MULTIPLICATION all along because that was the operation in the original post of this thread. In your example, you introduced DIVISION.
BTW, the term PRODUCT is only used for the result of a multiplication. The result of a divide is called the QUOTIENT. Well, so much for the English lesson.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.
Perhaps in Swedish the word product has a more general meaning like "result". Could be that product is of more general usage in other languages too. I'll check in Spanish, since I know of no equivalent word for quotient.
I'll have to be careful in the future, when addressing an international audience, not to use the word product, and perhaps replacing it with "the result of the multiplication".
Thanks, Z!re, for making me aware of this.
*****
If you are ahead of me, lead.
If you are behind me, follow.
If you are not doing anything,
Get out of the way.