Topic: Hi to all

I have this sum i need to be able to do in script, is this possible?


procedure computeTotal (Sender: string);
begin
      Inventory.Edit10.Value := (Inventory.Edit4.Value/Inventory.Edit5.Value);
end;



An error then Populate "//I need to divide the two values (invalid Floating Point Operation) error"

it seems to work fine with + - * but not the Divide / symbol

Any Thoughts?

Re: Hi to all

Hello Hmlamprecht,
Welcome to MVD - good choice!
The problem you have encountered is probably because you are trying to divide by 0, but it's easy enough to trap it.
Please have a look at the attached to achieve what you want.
Depending on what you want to do, you could also use a calculated field and not need a script at all.
Any questions, just post a message and someone will get back to you.
Regards,
Derek.

Post's attachments

Attachment icon hmlamprecht.zip 337.59 kb, 352 downloads since 2018-10-17