Computer Science Canada Just made my account here and Its my first question. |
Author: | naqibaba [ Thu Dec 03, 2009 3:50 am ] |
Post subject: | Just made my account here and Its my first question. |
The outpout should look like this : "The decimal equilent of 1/2 is 0.500 The decimal equilent of 1/3 is 0.300 .. .. The Decimal equilent of 1/10 is 0.100" I am having difficulty in calling the variables. Its showing an error here. "var first:=0.5 var last:=0.1 for count: first..last" "The error is "for range bound must be both integers, chars or elements of the same enumerated type." What does that mean? Once I am able to call these variables, Prog will be done. Its showing an error on both real and integer. I would greatly appreciate any help. |
Author: | Tony [ Thu Dec 03, 2009 4:11 am ] | ||
Post subject: | RE:Just made my account here and Its my first question. | ||
it appears that you are trying to have a forloop count from 0.5 to 0.1
What kind of values would you expect "count" to have, as the loop executes? |
Author: | naqibaba [ Thu Dec 03, 2009 9:04 am ] | ||
Post subject: | Re: RE:Just made my account here and Its my first question. | ||
Tony @ Thu Dec 03, 2009 4:11 am wrote: it appears that you are trying to have a forloop count from 0.5 to 0.1
What kind of values would you expect "count" to have, as the loop executes? This is not working. I have also tried "for decreasing count:0.5..0.1" but still the error is the same. This is killing me. |
Author: | Draymire [ Thu Dec 03, 2009 9:11 am ] | ||
Post subject: | Re: Just made my account here and Its my first question. | ||
try something like this
this should work, and it gives you your 0.5-0.1 like you want ![]() |
Author: | TheGuardian001 [ Thu Dec 03, 2009 9:12 am ] |
Post subject: | Re: Just made my account here and Its my first question. |
naqibaba wrote: This is not working. I have also tried "for decreasing count:0.5..0.1" but still the error is the same. This is killing me. What Tony means is, what values are in between 0.5 and 0.1? If you were to go through every value, what values would you get? And back to the error message Quote: "The error is "for range bound must be both integers, chars or elements of the same enumerated type." Do you know what an integer is? Are either of the bounds on your for loop integers? |