User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,121 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Views: 434 | Replies: 3
Reply
Join Date: May 2008
Posts: 2
Reputation: BinaryAssassin is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
BinaryAssassin BinaryAssassin is offline Offline
Newbie Poster

Pascal Question

  #1  
May 5th, 2008
Hey all,

I'm currently writing a program that will do various things with dates. The problem that I currently have is getting pascal to recognise dates in various formats (eg. 24/09/93 or 09-03-04 or 17 01 99, etc) when input by a user. This data needs to be read by pascal in a way that allows me to alter the output (ie. the date written out in full).

Any suggestions/solutions would be immensely appreciated.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Pascal Question

  #2  
May 5th, 2008
Take a look through this thread:
Tutorial: Handling Dates and Time in Delphi

Near the bottom there is some thoughts on reading dates (which is the hard part). Writing dates is easy.

Hope this helps.
Reply With Quote  
Join Date: May 2008
Posts: 2
Reputation: BinaryAssassin is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
BinaryAssassin BinaryAssassin is offline Offline
Newbie Poster

Re: Pascal Question

  #3  
May 7th, 2008
Thanks for the link/ help, Duoas. I've never used Delphi before, and although I can see the similiarities, I'm generally new to the programming game so I'm having some trouble understanding it.

If you have any words of wisdom in the Pascal programming language, that would be very useful indeed. Thanks again.
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Pascal Question

  #4  
May 9th, 2008
Heh, glad to have helped.

I know it takes a while to get your head around it, but the only way it will come is to struggle along... alas. But it will come, don't worry.

One of the most overlooked features in Delphi (IMHO) is the use of try...except blocks in data transformation. In simple terms, endeavor to do things one way. If the input doesn't match, raise an exception and catch that to try another way. Keep going until you either run out of ways to try or until the input matches.

Good luck.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Pascal and Delphi Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 2:32 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC