
-----------------------------------
slider203
Sun May 24, 2009 3:45 pm

I cant get my program to work properly
-----------------------------------
Hello could anyone please help me to figure out what is wrong with my code anyhelp woild be greatly appreciated.

const start:= "10"
const finish:= "1"
for decreasing count: start .. finish
put 12 div count
end for

I cant make it run and im not sure why

Thanks very much

-----------------------------------
Dusk Eagle
Sun May 24, 2009 3:57 pm

Re: I cant get my program to work properly
-----------------------------------
First, please use syntax tags, like this: 
%%code here

As for your problem, do you know what type of value your constants are (i.e. are they strings? or integers?). By declaring their type, you can be sure what type they are. Like this:

const x : int := 10

By putting quotation marks around the value of your variables, you have inadvertently made them strings, which is why your program will not run.

-----------------------------------
zero-impact
Sun May 24, 2009 4:37 pm

RE:I cant get my program to work properly
-----------------------------------
This is because for loops only work when you give them integers.

-----------------------------------
Kharybdis
Sun May 24, 2009 5:36 pm

Re: I cant get my program to work properly
-----------------------------------
const start:= "10"
const finish:= "1"
for decreasing count: start .. finish
put 12 div count
end for 

Should be ...


const start := "10"
const finish := "1"
for decreasing count : strint (start) .. strint (finish)
    put 12 div count
end for
