Setting the Frame.Typ in Script

Mark ElderMark Elder SD, USA
edited 1:56AM in FastReport 4.0
How can I set the Frame.Type in script? I have a frame defined in the designer, but if my field is empty I don't want to print the frame. I am trying this but it will not compile. I get an "Expression Expected" and the cursor is between the square brackets.

procedure Memo24OnAfterData(Sender: TfrxComponent);
begin
if Value = 0 then
begin
Memo24.Frame.Typ := [];
end;
end;

As far as I can tell type "Typ" is a TfrxFrameTypes which is a set of TfrxFrameType
TfrxFrameType = (ftLeft, ftRight, ftTop, ftBottom);
TfrxFrameTypes = set of TfrxFrameType;


If I put something in the set just to see it change that will not work either. This compiles
Memo24.Frame.Typ := [ftBottom];
however when I get to that line I have a runtime error "Could not convert variant of type (Array Variant) into type (Integer)"

Comments

  • gordkgordk St.Catherines On. Canada.
    edited May 2014
    use 0 frame typ is the sum of ft integer values or ftnone
  • Mark ElderMark Elder SD, USA
    edited 1:56AM
    OK that works. I'm assuming that the script does not support Sets, but the underlying implementation for a set is really just a bit field so I can treat the value as a integer.

    Anyway Thanks gordk!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.