PDA

View Full Version : date with MidletPascal



123jklm
13-02-2008, 04:04 PM
is it possible to count with date in MidletPascal. ex (delphi code)
Edit1.text := DateToStr (date - 25);

Chobley
13-02-2008, 06:00 PM
I'm very sorry I am not familiar with Delphi...you could perhaps wait for someone better to come on here and help with your problem...or if you can put down in "Pseudo" code what you are trying to I might be able to help...sorry a novice at programming but have been using MIDlet Pascal for a while now...

arthurprs
13-02-2008, 09:41 PM
is it possible to count with date in MidletPascal. ex (delphi code)
Edit1.text := DateToStr (date - 25);

-
edit: sorry i forget that date are a float..

AthenaOfDelphi
13-02-2008, 11:51 PM
is it possible to count with date in MidletPascal. ex (delphi code)
Edit1.text := DateToStr (date - 25);

I think the short answer is probably. The long answer is, it depends on how MidletPascal stores dates. If it uses a number format like Delphi, then the answer is yes. Ultimately, it makes sense to store dates as numbers as they are more compact (byte wise) than a string so I would say the answer is almost certainly yes. You just need to find out what format MidletPascal uses and adjust the maths accordingly.

Sorry I can't be more specific, but I've never actually used MidletPascal.

Chobley
14-02-2008, 08:34 AM
Right...beginning to get this a little more;

The date functions are as follows in MIDlet Pascal;

GetYear();
GetMonth();
GetWeekDay();
GetYearDay();

All are integers...

There is no DateToStr()

But there is an IntegerToString();

...There is no RealToString(); for floatingpoint/real numbers as far as I know in MP if your using real numbers you need to use the function Trunc(); to convert it without the decimal...

123jklm
16-02-2008, 07:53 PM
In delphi DateToStr (Date) show You YEAR-MONTH-DAY of this day.
DateToStr (Date + 4000) show You 4000 days forward and
DateToStr (Date - 4000) show You 4000 days back.
If You want to do the same in MidletPascal must You join GetDay,GetMonth and GetYear but how.

Chobley
17-02-2008, 12:44 PM
In delphi DateToStr (Date) show You YEAR-MONTH-DAY of this day.
DateToStr (Date + 4000) show You 4000 days forward and
DateToStr (Date - 4000) show You 4000 days back.
If You want to do the same in MidletPascal must You join GetDay,GetMonth and GetYear but how.

I dont know... not experienced enough but can only suggest you post your code on here and see if anyone could offer a work around