Thank you Regina, but
if I add an 'endif' at the end of the line
( " if a = b then a=1 Else a=2 endif 'test "),
the compiler fails with the message "Syntax error : unexpectes symbol :
End If".
Furthermore, the book from "OpenOffice .org Macros OoOffice et
Apis" from Bernard Marcelly and Laurent Goddard states p.118 :
"Lorsqu’une seule instruction suffit dans la partie Then et dans la
partie Else, la séquence peut s’écrire sur une seule ligne :
If expr1 Then instruction1v Else instruction1f
Notez l’absence du End If dans cette forme simplifiée."
which means, translated :
"When only one instruction is used in the section Then and in the
section Else, the sequence can be written on one single line :
If expr1 Then instruction1v Else instruction1f
Please note the absence of End If in this simplified usage"
Therefore I still consider this as a bug.
With kind regards,
Lucien
Le 6/06/22 à 13:32, Regina Henschel a écrit :
Hi Lucien,
Lucien Mathay schrieb am 06.06.2022 um 10:42:
Hello,
I would like to report the following bug : in the macros when a line
containing "if ... then ... else" is followed by a comment on the
same line, the compiler fails.
Example :
Function test()
dim a as long, b as long
a=0: b=0
if a = b then a=1 else a=2 'test
b=1
call msgbox b
End Function
The if-statement misses endif.
Kind regards,
Regina