Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-03

True and False

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marc Weustink
to Luis R. Hilario B.: "Error Unable to rename variable in source. See messages." But does not appear nothing…

+ From: Luis R. Hilario B.

Hi, it's not a solution for your problem, but it might prevent strange results in the future.

+
+ In order to write some components (of the Boolean type) it is necessary
+ to make the following thing, e.g.:
+
+ CheckBox2.Checked := False; CheckBox2.Checked := True; +
+ CheckBox2.Checked := Boolean(RecordDataI[fnFACT_SIN_EX]);

It is better not to cast a boolean like this

       CheckBox2.Checked := RecordDataI[fnFACT_SIN_EX]  0;

has the same effect (assumed that RecordDataI contains integers), but now you are sure CheckBox2.Checked is a "true" boolean.

At least in Delphi casting something like Boolean(1) results to true in some expressions and to false in other

Marc

Reply by email

Luis R. Hilario B.

Hello,

"Error
Unable to rename variable in source.
See messages."

But does not appear nothing (no message).

The error takes place when trying to rename a variable, if it is selected. ---

In order to write some components (of the Boolean type) it is necessary to make the following thing, e.g.:

     CheckBox2.Checked := False; CheckBox2.Checked := True;
     CheckBox2.Checked := Boolean(RecordDataI[fnFACT_SIN_EX]);

Is a problem or is normal?
---

Also it passes something similar with RadioGroup.
So that it works well I must do the following thing:

     RadioGroup1.Items.Text := '';
     RadioGroup1.Items.Text := rsFisico+#13#10+rsServicio;
     RadioGroup1.ItemIndex := RecordDataI[fnPROD_TIPO];
---

With Combobox also there is a problem, so that it works I must do the following thing:

     Index := Combobox2.Items.IndexOf(RecordData[fnPROVEEDOR1]);
     if Index > -1 then
     begin
       Combobox2.ItemIndex := Index;
       Combobox2.Text := RecordData[fnPROVEEDOR1]; // When this line
really is not necessary.
     end...

Note: The failure really notices when the same window is opened to several times.

Reply by email