Hi
Try this
start=(url.vedio_id/10)*10+1
end=((url.vedio_id/10)+1)*10
Srinivas
On 8/25/06, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
I want to loop over a URL.VIDEO_ID value and find the numeric range it
falls in.
The value range needs to be between 1-10 or 11-21 etc. until the condition
this should work if i understand what you are trying to do:
!--- set start to id divided by 10, rounded down to nearest integer.
Multiply by ten and add one ---
cfset start = (int(url.video_id/10) * 10) + 1
!--- set end to id divided by 10 and rounded up, multiply by 10 ---
Cfset end =
cfset iStart = Int(url.video_id/10)*10 + 1
cfset iStop = Int(url.video_id/10)*10 + 10
cfloop from=#iStart# to=#iStop# index=i
/cfloop
Greetings / GrĂ¼sse
Gert Franz
Customer Care
[EMAIL PROTECTED]
www.railo.ch
Join our Mailing List / Treten Sie unserer Mailingliste bei:
deutsch:
from how i understood this the loop was only being used to ascertain the
final range start and end values?
if you are using int/ceiling to find these out - then the looping isn't
necessary ?
On 8/25/06, Gert Franz [EMAIL PROTECTED] wrote:
cfset iStart = Int(url.video_id/10)*10 + 1
cfset
I don't think you need to loop at all. Your ranges are 10 numbers
apiece, right?
cfset currentValue=72
cfset rangeSize=10
!--- Use integer division ---
cfset startValue=currentValue \ rangeSize * rangeSize + 1
cfset endValue=startValue + rangeSize - 1
\ is the operator for integer division.
72
5 matches
Mail list logo