5 Replies - 8807 Views - Last Post: 07 November 2007 - 11:38 AM Rate Topic: -----

#1 kanchi2k  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 02-November 07

Need help counting backwards in a loop

Post icon  Posted 02 November 2007 - 07:08 AM

i have prob in my asp code to print reverse of a given number

<HTML>
<HEAD>
<TITLE>Reverse of a number</TITLE>
</HEAD>
<BODY>
<% Dim num
	num=123456 %>
<% for i=0 to 5 step -1
	response.write num(i)
	next %>
</BODY>
</HTML>



I will be grateful to anyone who can help me

This post has been edited by PsychoCoder: 06 November 2007 - 06:05 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Need help counting backwards in a loop

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Need help counting backwards in a loop

Posted 02 November 2007 - 07:49 AM

Two things:

First off, put your code into code tags like this: ::code::

Secondly, what error are you getting? What isn't working?
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Need help counting backwards in a loop

Posted 02 November 2007 - 06:46 PM

View Postkanchi2k, on 2 Nov, 2007 - 07:08 AM, said:

plzz send me the solution!!!


This will not happen, we're not going to just create the solution to your issue and give it to you, thats not how it works here at </dream.in.code> :)

And as girasquid pointed out, you have to tell us whats not working, what error are you getting, whats this code doing versus what you want it to do. Saying "it isn't working" tells us nothing, and we aren't, well most of us, mind readers.
Was This Post Helpful? 0
  • +
  • -

#4 praspam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 06-November 07

Re: Need help counting backwards in a loop

Posted 06 November 2007 - 04:20 AM

make this changes
<%for i=5 to 0 step -1
response.write num(i)
next %>


<HTML>
<HEAD>
<TITLE>Reverse of a number</TITLE>
</HEAD>
<BODY>
<% Dim num
	num=123456 %>
<%for i=0 to 5 step -1
	response.write num(i)
	next  %>
</BODY>
</HTML>



plzz send me the solution!!!
[/quote]

This post has been edited by PsychoCoder: 06 November 2007 - 05:44 AM

Was This Post Helpful? 0
  • +
  • -

#5 kanchi2k  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 02-November 07

Re: Need help counting backwards in a loop

Posted 07 November 2007 - 03:12 AM

View Postpraspam, on 6 Nov, 2007 - 04:20 AM, said:

make this changes
<%for i=5 to 0 step -1
response.write num(i)
next %>


hi praspam... thnx but its not working... i am getting an error again... may be there is a problem with "num(i)" but dont know what???? can anyone tell me where m i wrong???


[b][color=#993399]hey everyone.. problem with the code is that... its not showing anything on the screen.... screen is not showing any output rather its blank!!!! what do i do??? :blink:
Was This Post Helpful? 0
  • +
  • -

#6 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Need help counting backwards in a loop

Posted 07 November 2007 - 11:38 AM

Response.Write is a function. You are missing the parenthesis.

response.write(num(i))



In the future, it is helpful if you include the error message in your post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1