Joeydenhaag Posted May 18, 2020 Share Posted May 18, 2020 Global Const $HEADER_ITEMTYPE_SKILLTOME = 9 Global Const $HEADER_ITEMTYPE_GOLDCOINS = 20 If ($itemType = $HEADER_ITEMTYPE_SKILLTOME Or $itemType = $HEADER_ITEMTYPE_GOLDCOINS) Then Return True Endif Hi guys, new AutoIt programmer here. I'm not entirely sure why I am getting the following errors . I assume its because I am using "Or" incorrectly. Would be sweet if someone could point the issue out Quote (504,50) : error: syntax error If ($itemType == $HEADER_ITEMTYPE_SKILLTOME Or ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ (504,50) : error: unbalanced paranthesis expression. If ($itemType == $HEADER_ITEMTYPE_SKILLTOME Or ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ (504,50) : error: multi-line 'If' missing 'Then'. If ($itemType == $HEADER_ITEMTYPE_SKILLTOME Or ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ (505,43) : error: syntax error $itemType = $HEADER_ITEMTYPE_GOLDCOINS) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ (509,4) : error: syntax error Endif ~~~^ (509,4) : error: Statement cannot be just an expression. Endif Link to comment Share on other sites More sharing options...
TheXman Posted May 18, 2020 Share Posted May 18, 2020 Some languages allow you to continue a line like that but in AutoIt, the line continuation character is the underscore (_). So if you wanted to break up your if statement like that, it would look like this: Global Const $HEADER_ITEMTYPE_SKILLTOME = 9 Global Const $HEADER_ITEMTYPE_GOLDCOINS = 20 If ($itemType = $HEADER_ITEMTYPE_SKILLTOME Or _ $itemType = $HEADER_ITEMTYPE_GOLDCOINS) Then Return True Endif CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now