Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


extended variant compare error

extended variant compare error

extended variant compare error

hi all;
i am using firebird 2.5, fibplus and delphi xe2 (updated) on windows7 64 bit.

CODE --> delphi

if dYMBP['HKS_PUANI'].AsFloat >= 0.96 then
    extHKS := 1.05
    extHKS := 1; 
returns extHKS = 1;

At db dYMBP['HKS_PUANI'].AsFloat value is 0.96 and HKS_PUANI field is numeric(2,2). if i change the 0.96 value to 0.95 at db and code its working.

CODE --> delphi

if dYMBP['HKS_PUANI'].AsFloat >= 0.95 then
    extHKS := 1.05
    extHKS := 1; 
returns extHKS = 1.05;

after these i changed the 0.95 value 0.96 at db and code and when i try the below code its working

CODE --> delphi

extDeg = 0.96
if dYMBP['HKS_PUANI'].AsFloat >= extDeg then
    extHKS := 1.05
    extHKS := 1; 
returns extHKS = 1.05;

if i compare the value with variant its working.

that code is working too

CODE --> delphi

if math.CompareValue(dYMBP['HKS_PUANI'].AsFloat,0.96) in [0,1] then
    extHKS := 1.05 

what the problem? i try above codes at another machines. is debugger error or am i making something wrong?
Best Regards;

RE: extended variant compare error

thnks asCurrency solve the problem. asFloat is not working stable because i tried 0,86 value it worked like 0,96 but 0,76 is working normally and 0,66 0,56 is working normally too. Interesting ponder

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close