[Solved] Nested IF's / logical operators?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
gurkand
Posts: 29
Joined: Wed Feb 28, 2018 10:27 am

[Solved] Nested IF's / logical operators?

Post by gurkand »

Hi All,

Not at home, therefore cannot test it myself, want to prepare the stuff now as it will take some time...

If <condition1> AND <condition2> Then
...
End If

Will this one work, or do I need to code this as the following?

If <condition1> Then
If <condition2> Then
...
End If
End If

Thanks in advance.

Regards,
Last edited by gurkand on Wed Feb 28, 2018 8:13 pm, edited 1 time in total.
LibreOffice 6.3
FJCC
Moderator
Posts: 9273
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Nested IF's / logical operators?

Post by FJCC »

This will work:

Code: Select all

If <condition1> AND <condition2> Then
...
End If
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Nested IF's / logical operators?

Post by JeJe »

It can help clarity to use brackets.

Code: Select all

If (<condition1> AND <condition2>) Then
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Post Reply