Hi.

I am getting an EInvalidOp exception in a section of code I have that has
previously worked and I am certain I havent changed anything in that area
for months...this code is now not working and Im at a loss to explain why...

basically I am getting the error raised on this line

      s_thedate := format_date_2_mysql(trunc(e_mymean),s_yearname);

the format_date_2_mysql just takes a float and reformats the value to a
mysql date as follows and s_yearname is a string "2002"
There are two functions that are called repeatedly initially that calculate
e_mymean but the result is 37500.63

function format_date_2_mysql(s_val:float;s_year:string): string;
var
  w_year,w_month,w_day:word;
begin
  //format the date to what we want

decodedate(strtodate(formatdatetime(s_date_format,s_val)),w_year,w_month,w_d
ay);
  if s_year = s_empty then
  begin
    result := inttostr(w_year) + '-' + inttostr(w_month) + '-' +
inttostr(w_day);
  end
  else
  begin
    result := s_year + '-' + inttostr(w_month) + '-' + inttostr(w_day);
  end;
end;

can anyone please tell me what this error is (I looked at the help file and
it could be one of three things but how can I tell which?)

also can anyone please suggest a process to follow to sort it out?

I think it has something to do with the data type I am using (extended) but
on the other hand I cant see this being an issue as this is the most
significant datatype for real anyway...

Hoping and praying for advice

Chris Veale

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 24/10/02




______________________________________________________
The contents of this e-mail are privileged and/or confidential to the
named recipient and are not to be used by any other person and/or
organisation. If you have received this e-mail in error, please notify 
the sender and delete all material pertaining to this e-mail.
______________________________________________________
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to