-5
var
  iMath, iAfr: integer;
begin
  if cbMath.checked then
    iMath := sedMathf.value div sedmatho.value and iMath * sedmathm.value
  else
    sedAfrm.setfocus;
end;

My variables do not want to be initialized, how can I prevent this or fix this?

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 3
    By debugging the code of course. – Sertac Akyuz Mar 27 '19 at 01:14
  • Which variable doesn't want to be initialized? And what should it be initialized to? – Sam M Mar 27 '19 at 01:25
  • 2
    `iMath` is not initialized before you use it in the calculation of the value of `iMath`. Read the code. Where does the value of `iMath` come from when you use it in `and iMath * edmathm.value`? – Ken White Mar 27 '19 at 02:00

1 Answers1

4

You are trying to set iMath to a value using iMath. The right hand side of your assignment is undefined.

JacalarRick
  • 153
  • 1
  • 8