Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2006, 01:25 PM
Authorized User
 
Join Date: Jan 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Store time into Array

Hi, how do I go about storing time into array? I want to loop until 1 minute which is 60 seconds. Eg. I store the datetime and add 1 second to it in the loop and store in array? I have my for loop but I just can't get it to add 1 second to it?

        For i = 0 To 60 Step 1
            Dim msg As DateTime = DateTime.Now.ToShortTimeString

            Response.Write(msg & "<br />")

            Dim msg2 As DateTime = msg.AddSeconds(1.0)


        Next

please help, thanks

 
Old December 18th, 2006, 08:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there..

i didn't understand what's your point here..

you are doing a loop 60 times (not 60 seconds)..

if you need to loop for 60 seconds you can do something like

Code:
Dim msg As DateTime = DateTime.Now.ToShortTimeString
while msg.AddSeconds(60).CompareTo(DateTime.Now.ToShortTimeString) = 0
... do something here...
loop
I don't see any array in your code...

HTH

Gonzalo
 
Old December 18th, 2006, 08:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

anyway.. besides that.. you know that there is a timer control... don't you?

HTH

Gonzalo
 
Old December 18th, 2006, 09:41 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Or if you want to just hold an operation for 60 seconds you can do:

System.Threading.Thread.Sleep(60)

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
Store Array of Form Values lbunnell Beginning PHP 1 June 21st, 2005 10:13 AM
can i store array values in a column using sqlser anil_76781 SQL Server 2000 1 May 10th, 2005 04:35 AM
How to get bitmap pixel to store in the array ck C++ Programming 1 January 20th, 2005 05:02 PM
How to get bitmap pixel to store in the array ck Visual C++ 0 December 23rd, 2004 02:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.