Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 16th, 2006, 01:25 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
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

  #2 (permalink)  
Old December 18th, 2006, 08:46 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
  #3 (permalink)  
Old December 18th, 2006, 08:47 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
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
  #4 (permalink)  
Old December 18th, 2006, 09:41 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:24 AM.


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