Lib package compilation error

All except GUI problems
Post Reply
dmaksimiuk
Posts: 28
Joined: Sun Jun 14, 2015 3:56 pm
Location: Delft, The Netherlands

Lib package compilation error

Post 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
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Lib package compilation error

Post 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
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Lib package compilation error

Post 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
Zinn
Posts: 123
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main
Contact:

Re: Lib package compilation error

Post 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.
dmaksimiuk
Posts: 28
Joined: Sun Jun 14, 2015 3:56 pm
Location: Delft, The Netherlands

Re: Lib package compilation error

Post by dmaksimiuk »

Dear Helmut & Robert,
Thanks for your help and answers. The Lib package compiles without any problems.

Cheers,
Darek
User avatar
Robert
Posts: 177
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: Lib package compilation error

Post 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
Post Reply