Error: unexpected '}' in "}" when I write an IF ELSE code

Hello,
I'm trying to perform a simple if else, but I get an error.
This is the code

if (.Platform$OS.type="unix"){
print(10)  
}else{
  print(30)  
}

I always receive this:
Error: unexpected '}' in "}"
I know it's an issue when the bracket is closing, but I can't figure It out.
Sorry if this seems so trivial.
Thanks for your time and interest.

you have omitted an = from the test within if. comparison uses == operator.

if (.Platform$OS.type=="unix"){
print(10)  
}else{
  print(30)  
}
1 Like

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.