if then else with multiple assignments

edited August 2018 in FastReport VCL 5
Hi,

I want to use this code:

begin
if (<AuftragsKopf."KENNZ1"> = 'WfE') then
Set( 'variable1','''text1''');
Set( 'variable2','''text2''');
Set( 'variable3',''''+<Bearbeiter."PersAnrede">+'''' );
Set( 'variable4','''text3''' );
Set( 'variable5','''40''' );
pictureBasisKopfLogo.Visible := False;
pictureBasisKopfLogoWfE.Visible := True;
else
Set( 'variable1','''text10''');
Set( 'variable2','''text20''');
Set( 'variable3',''''+<Bearbeiter."PersAnrede">+'''' );
Set( 'variable4','''text30''' );
Set( 'variable5','''30''' );
pictureBasisKopfLogo.Visible := True;
pictureBasisKopfLogoWfE.Visible := False;
end;

I get everytime the error Message: ';' expected (bevor the "else").
I tried it everywhere with ";" and without.
What can I Do?

Comments

  • edited 10:09AM
    syntax should be like :

    IF (1=1) THEN
    BEGIN
    abc:=5;
    END
    ELSE
    BEGIN
    abc:=9;
    END;

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.