Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 26th, 2007, 5:55 PM   #1
Emperor
Newbie
 
Join Date: Apr 2005
Posts: 10
Rep Power: 0 Emperor is on a distinguished road
Question Adding to a date variable?

Hey guys, basically what I have is a date variable in the following format: mm/dd/yyyy and I'm trying to allow the user to add either days, months or years to this date by typing the following into a text box: 5 Days or 10 Months or 20 Years etc etc etc. Basically a number then a space then what they're adding(Days, Months, or Years).

I'm having trouble figuring out how to make it so it reads the number part and just takes that and adds it to a specified field in the date. Could anyone help me on this? Thanks.
Emperor is offline   Reply With Quote
Old May 11th, 2007, 12:11 AM   #2
physicist
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 146
Rep Power: 2 physicist is on a distinguished road
set an integer = to each component of the date,
then on Text1_Changed sub procedure
have it so that it takes the val(text1.text) and sets that to another variable, having it take the val of the string entered into the textbox takes only the number part provided they typed like 12 months and not like 12 mon23432ths343242 and then read the string for "month, day, year" store the last part of string (the "month" "day" or "year") to a variable and do a select case
case "month"
store numeric variable (the val(text1.text)) in place of month
and so on....
physicist is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a # value to the end of another variable kworden PHP 6 Dec 13th, 2006 12:26 PM
converting string to float beginnerCCC C 22 Oct 2nd, 2006 11:59 PM
Compiling Maverik 6.2 (from C) megamind5005 C 16 May 3rd, 2006 5:41 PM
Php Postgresql Class Pizentios Show Off Your Open Source Projects 15 Jun 28th, 2005 9:55 AM
Pointers in C (Part II) Stack Overflow C 2 Apr 29th, 2005 10:39 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:19 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC