954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Pascal Question

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.

BinaryAssassin
Newbie Poster
4 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

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.

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

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.

BinaryAssassin
Newbie Poster
4 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

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.

Duoas
Postaholic
2,043 posts since Oct 2007
Reputation Points: 1,140
Solved Threads: 229
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You