Page 1 of 1

Lib package compilation error

Posted: Sun Jun 14, 2015 5:42 pm
by dmaksimiuk
Hi All,
I am trying to compile Robert's Lib package under BBox 1.7-RC6 built 44. I got the following compilation errors in:
1. LibFonts
IF Fonts.italic IN style THEN font.lfItalic := 1X <- incompatible assignment
ELSE font.lfItalic := 0X <- incompatible assignment END;
IF Fonts.underline IN style THEN font.lfUnderline := 1X <- incompatible assignment
ELSE font.lfUnderline := 0X <- incompatible assignment END;
IF Fonts.strikeout IN style THEN font.lfStrikeOut := 1X <- incompatible assignment
ELSE font.lfStrikeOut := 0X <- incompatible assignment END
2. LibPlot3D (in PROCEDURE (g : SurfGraphic) Restore2 (f : Views.Frame))
Line: res := Api.Polygon (dc, pts[0] <- actual parameter corresponding to open array is not an array, k);

I have compiled the Lib package under BBox 1.7-RC4 built 15 without any problems.

Your help is very welcome.

Cheers,
Darek

Re: Lib package compilation error

Posted: Mon Jun 15, 2015 6:39 pm
by Zinn
1. In LibFonts change the lines
IF Fonts.italic IN style THEN font.lfItalic := 1X ELSE font.lfItalic := 0X END;
IF Fonts.underline IN style THEN font.lfUnderline := 1X ELSE font.lfUnderline := 0X END;
IF Fonts.strikeout IN style THEN font.lfStrikeOut := 1X ELSE font.lfStrikeOut := 0X END;
to
font.lfItalic := Fonts.italic IN style;
font.lfUnderline := Fonts.underline IN style;
font.lfStrikeOut := Fonts.strikeout IN style;
and the lines
IF font.lfItalic # 0X THEN style := style + {Fonts.italic} END;
IF font.lfUnderline # 0X THEN style := style + {Fonts.underline} END;
IF font.lfStrikeOut # 0X THEN style := style + {Fonts.strikeout} END;
to
IF font.lfItalic THEN style := style + {Fonts.italic} END;
IF font.lfUnderline THEN style := style + {Fonts.underline} END;
IF font.lfStrikeOut THEN style := style + {Fonts.strikeout} END;
and compile again

2. In LibPlot3D change the line
res := Api.Polygon (dc, pts[0], k);
to
res := Api.Polygon (dc, pts, k);
and compile again

Re: Lib package compilation error

Posted: Mon Jun 15, 2015 10:02 pm
by Robert
I am curious about these changes.

While I guess these are only cosmetic changes, and the actual code does the same thing, I can't immediately find the evidence in the BlackBox documentation.

The changes seem to rely on three "facts":

- The internal memory representation of BOOLEAN is 1 byte.
- The coding for FALSE is 0.
- The coding for TRUE is 1.

The Docu for Stores says this is true externally (ie on disc), but how do we know it is true in memory?

Is this stated in some Docu?

Robert

Re: Lib package compilation error

Posted: Tue Jun 16, 2015 6:16 am
by Zinn
Yes, the original old coding rely on this facts.
The new version eliminates this facts in the source.
You don't have to know it anymore.
Now it is the task of the compiler to know this facts.

Re: Lib package compilation error

Posted: Tue Jun 16, 2015 6:23 am
by dmaksimiuk
Dear Helmut & Robert,
Thanks for your help and answers. The Lib package compiles without any problems.

Cheers,
Darek

Re: Lib package compilation error

Posted: Wed Jun 24, 2015 10:09 am
by Robert
Following discussions (see http://forum.blackboxframework.org/view ... f=40&t=261) it has been decided to undo some of the changes to WinApi used above.

So, ultimately (I can't predict precise timescales) it will be necessary to undo the above changes to LibFonts. The change to LibPlot3D will stay.


The pleasures of using unstable releases! But it is helpful to development as it exposes problems.

Regards

Robert