# Extra long string error

**URL:** <https://forum.inductiveautomation.com/t/extra-long-string-error/3683>\
**Category:** Ignition\
**Created:** [December 1, 2011, 8:59pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683 "2011-12-01T20:59:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_stc](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@scott\_stc](https://forum.inductiveautomation.com/u/scott_stc)\
**Post date:** [December 1, 2011, 8:59pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/1 "2011-12-01T20:59:56Z")

</div>

Could somebody please help with the error resulting from the following code:

`if varBinNmbr == "" or varBin_Cap == ""	or varLbs_Per_Bush == ""or varGrain_Type == ""
     or varAdd_Subt_Lbs == ""or varCurrent_Bin_Weight == ""	or varCurrent_Bin_Bushels == ""
     or varDEFECT_INPUT_1 == ""or varDEFECT_INPUT_2 == ""or varDEFECT_INPUT_3 == "":
	system.gui.messageBox("Please enter in a Bin # and Parameters")`

The error is this:

[quote]Unable to register action actionPerformed  
Parse Error:  
Traceback (innermost last):  
(no code object) at line 0  
SyntaxError: (‘invalid syntax’, (’’, 23, 141, ‘if varBinNmbr == “” or varBin\_Cap == “”\tor varLbs\_Per\_Bush == ""or varGrain\_Type == ""or varAdd\_Subt\_Lbs == ""or varCurrent\_Bin\_Weight == “”’))[/quote]

The error refers to the end of the first line, as though the line break is not correct, but trying different symbology and indents does not seem to work. Any help is appreciated.  
Thank you.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [December 1, 2011, 9:03pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/2 "2011-12-01T21:03:28Z")

</div>

Well, I can see the indents correctly but you need:`if varBinNmbr == "" or varBin_Cap == "" or varLbs_Per_Bush == "" or varGrain_Type == "" or varAdd_Subt_Lbs == "" or varCurrent_Bin_Weight == "" or varCurrent_Bin_Bushels == "" or varDEFECT_INPUT_1 == "" or varDEFECT_INPUT_2 == "" or varDEFECT_INPUT_3 == "":
    system.gui.messageBox("Please enter in a Bin # and Parameters")`Make sure you have spaces between each or and have the if on one line.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 1, 2011, 9:07pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/3 "2011-12-01T21:07:53Z")

</div>

> [@Travis.Cox](#):
>
> Make sure you have spaces between each or and have the if on one line.

Or put parenthesis around the if argument:

`if (varBinNmbr == "" or 
  varBin_Cap == "" or 
  varLbs_Per_Bush == "" or 
  varGrain_Type == "" or 
  varAdd_Subt_Lbs == "" or 
  varCurrent_Bin_Weight == "" or 
  varCurrent_Bin_Bushels == "" or 
  varDEFECT_INPUT_1 == "" or
  varDEFECT_INPUT_2 == "" or 
  varDEFECT_INPUT_3 == ""):
    system.gui.messageBox("Please enter in a Bin # and Parameters")`

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 1, 2011, 9:15pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/4 "2011-12-01T21:15:54Z")

</div>

A bit more information:

The problem with the original is that python had no idea that there was more stuff to process on the next line. Putting the whole thing in parenthesis forces the interpreter to keep going until it sees the end.

Here’s the [style guide](http://www.python.org/dev/peps/pep-0008/) if anyone’s interested… or, here it is even if there isn’t anyone interested… ![:mrgreen:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/d23659b203d2d24d394be983a52adb2fa6fe23d4.gif "Mr. Green")

The guide’s ten years old, but for the most part, still relevant.

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [December 2, 2011, 1:28pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/5 "2011-12-02T13:28:44Z")

</div>

Jordan,

I like that reference. Thought this may keep if from going into a black hole some place… 😮  
[Style Guide.pdf](https://us1.discourse-cdn.com/inductiveautomation/original/1X/61540b3c9ec1ca1d3b03511e073869a956d1d82a.pdf) (56.2 KB)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [December 2, 2011, 2:24pm UTC](https://forum.inductiveautomation.com/t/extra-long-string-error/3683/6 "2011-12-02T14:24:03Z")

</div>

> [@AxisIt](#):
>
> I like that reference. Thought this may keep if from going into a black hole some place... 😮

On the internet?!? that doesn't happen, does it? 😆
