Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by Aegon · Dec 13, 2010 at 03:06 PM · booleanboo

if(!something) doesn't work in Boo, why?

When I want to check if something is true or false in an if() statement in JavaScript I just go if(something) or if(!something).

if(!something) doesn't work in Boo apparently, it gives this error: Assets/Code/Boo Creation.boo(9,12): BCE0044: unexpected char: '!'.

What is the proper way to do this in Boo? Thank you.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Xathos · Mar 07, 2011 at 01:48 AM

I'm kind of surprised that no one has really answered this yet...

if not something:
   DoSomething()

I should also add that although there isn't all that much documentation for Boo itself, this shouldn't prove to be too much of a barrier: Boo is a CLI language with Python inspired syntax. Thus, boo behaves like C#, and shares the same API (if with different keywords), while it's syntax is practically identical to Python. If you're interested in using Boo, first learn python (an awesome language in and of itself), and then go to boo.codehaus.org to get up to speed on the (few) syntactic differences with python.

The only real impediment with learning boo is the syntax, as mechanically, it's practically identical to C# and UnityScript.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · May 07, 2012 at 06:47 PM 0
Share

For the record, @Proclyon had came up with this... Though in a more complicated and uncertain fashion.

avatar image
3

Answer by Justin Warner · Dec 13, 2010 at 03:19 PM

http://boo.codehaus.org/Part+03+-+Flow+Control+-+Conditionals

Would it be if(something != true)??

Not much documentation on the Boo language...

Also, http://boo.codehaus.org/BooManifesto.pdf

Check page 8, their's an example saying: if not __

That might help as well, good luck!

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Justin Warner · Dec 13, 2010 at 03:21 PM 0
Share

Also, not going to lie... I'd highly advise not using Boo... It's not documented, barely any users use it, and unless you actually know the language, then it'd be completely pointless to use it... Support is slim... Sorry.

avatar image Aegon · Dec 13, 2010 at 03:22 PM 0
Share

I suppose if(something!=true) would work but I didn't think I'd have to do it that way. I really don't like the "if not something" that Boo uses, but I guess there won't be a language I like everything about. Thanks.

avatar image Justin Warner · Dec 13, 2010 at 04:07 PM 0
Share

Sorry, C and Java both have many work arounds to things, and most languages share the same syntax, but are also different, you just have to work with them enough to fully understand it I guess... But oh well, good luck none-the-less.

avatar image Proclyon · Dec 13, 2010 at 05:00 PM 0
Share

haha , the only reason I even knew it was a code language (I think) is because I noticed it in the drop down menu's of the script reference site when I was replacing the JS samples for C# :F

avatar image
1

Answer by Proclyon · Dec 13, 2010 at 03:17 PM

From:http://boo.codehaus.org/Part+06+-+Operators

Logical Not "not a" Only use when a is a boolean value

Never used boo, just googled your question and found it in about 30 seconds. Just wondering, does it work?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Lacrymology · May 17, 2011 at 06:45 PM

if not something:
    doStuff()

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Shields 'always' inactive. Player object doesn't recognise if child exists(Solved) 1 Answer

Detect perimetral walls of a room 1 Answer

Spawn Object If Boolean Equals True, Boolean Set To True On Level Load 1 Answer

Error : Animator has not been initialized. UnityEngine.Animator:SetBool(String, Boolean) 1 Answer

Help needed on c# code which all of you will find basic apart from me 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges