I have a question about if statements.

In Verse code, I have seen code like if . (Conditional), I have seen a code like .
What exactly is the.
If you can help me, I would like to know.
I would also appreciate a link to the documentation.
I read the Verse Language Quick Reference, but I couldn’t find anything about the . after the if, but I couldn’t find anything about it.

Ok so there’s mainly 3 ways to run code after an if (also applies to other stuff like spawn and generally mostly anything that takes a :
Using the . unlike normal block of code allows you to run 1 expression,

So while it can be good if you have 1 thing you want to do without breaking into many lines, it can’t be used if you plan on having many expressions

Here’s some use cases

Example 1:
if(0=0). Print("0 EQUAL TO 0")

Example 2:

if(0=0):
  Print("0 EQUAL TO 0")

Example 3:

if(0=0){ Print("0 EQUAL TO 0") }

Another example with spawn

instead of spawn{MyFunction()} or

spawn:
    MyFunction()

You can do spawn. MyFunction()

Hope this solves your question :heart:

1 Like

Thank you for making it so clear!
It was really easy to understand because you presented three different ways of doing if statements!

1 Like

No worries glad it helped you understand :white_heart: have a good weekend

1 Like

Sorry it took so long to reply! Thank you very much! Thanks to the forum, I’m really enjoying learning UEFN!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.