Page 2 of 3
Posted: Sat Sep 17, 2005 12:51 pm
by Patz QuickBASIC Creations
moneo wrote:PQBC wrote:I use this when I need to make a number have 4 decimal places.
Code: Select all
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.
Posted: Sat Sep 17, 2005 1:11 pm
by moneo
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?
*****
Posted: Sat Sep 17, 2005 1:29 pm
by Patz QuickBASIC Creations
I was joking around...
Anyway, If I find a solution to my QB problem, I'll be sure to tell you.
Posted: Sat Sep 17, 2005 1:41 pm
by moneo
PQBC wrote:.....If I find a solution to my QB problem, I'll be sure to tell you.
Can you run DOS at all on your Internet machine?
If not, have you considered booting DOS either with a dual-boot option or from a diskette?
If you can get to DOS by either of the above methods, then you can compile, test, and run your programs with Quickbasic 4.5 directly in DOS.
*****
Posted: Sat Sep 17, 2005 2:41 pm
by Z!re
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.
Code: Select all
DIM a AS DOUBLE
DIM b AS DOUBLE
DIM c AS DOUBLE
a = 1.1
b = 2.7
c = a / b
PRINT c
Maybe you missed it when I posted it a few posts ago..
Posted: Sat Sep 17, 2005 3:09 pm
by Nodtveidt
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.

Posted: Sat Sep 17, 2005 4:21 pm
by Z!re
There is really no 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?
Posted: Sat Sep 17, 2005 5:54 pm
by Nodtveidt
あなたへのおはよう!
Posted: Sat Sep 17, 2005 6:41 pm
by moneo
Z!re wrote: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.
Code: Select all
DIM a AS DOUBLE
DIM b AS DOUBLE
DIM c AS DOUBLE
a = 1.1
b = 2.7
c = a / b
PRINT c
Maybe you missed it when I posted it a few posts ago..
No, I didn't miss the divide instead of the multiply, but I figured that the math operation didn't matter for what the issue was.
Plus, I usually don't touch your code with a ten foot pole, 'cause you'll bite my head off.
*****
Posted: Sun Sep 18, 2005 6:03 am
by Z!re
Moneo: I was correcting you.. decimals are determined by the variable type, not the number of decimals used in the factors
Sodacan: Poop
Posted: Sun Sep 18, 2005 10:42 am
by moneo
Z!re wrote:Moneo: I was correcting you.. decimals are determined by the variable type, not the number of decimals used in the factors.....
I can't figure out what you were correcting, but that's ok, you go ahead and correct whatever you want.
*****
Posted: Mon Sep 19, 2005 7:03 am
by Z!re
moneo wrote:f the IPNUM had 2 decimals, then 2 + 1 of the .9 can give you a maximum of 3 decimal places in the PRODUCT.
That's wrong.
Posted: Mon Sep 19, 2005 12:02 pm
by {Nathan}
Z!re... how old are you, and are you blonde?
Posted: Mon Sep 19, 2005 12:24 pm
by Z!re
I'm 20, and yes.
Posted: Mon Sep 19, 2005 2:49 pm
by moneo
Z!re wrote:moneo wrote:f the IPNUM had 2 decimals, then 2 + 1 of the .9 can give you a maximum of 3 decimal places in the PRODUCT.
That's wrong.
I'll admit that my sentence could have been written clearer, but what part do you consider wrong?
A product can have as many maximum decimals as the sum of the decimals in the multiplicand and the multiplier. Do you agree?
*****
Posted: Mon Sep 19, 2005 6:22 pm
by Z!re
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..
Posted: Mon Sep 19, 2005 6:52 pm
by moneo
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.
*****
Posted: Tue Sep 20, 2005 5:06 am
by Z!re
My bad, in swedish product refers to both multiplication and division..
Posted: Tue Sep 20, 2005 1:11 pm
by moneo
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.
*****
Posted: Tue Sep 20, 2005 2:04 pm
by Z!re
The word product, inswedish, has the same meaning as in english..
Product = The result of something, a process, math, etc..
"This product is good"
And don't sweet it, I just thought of it because someone asked me about it..
(The 1.1/2.9 that is, which we now know wasnt used or refered to)