Extra long string error

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.

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.

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")

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 if anyone’s interested… or, here it is even if there isn’t anyone interested… :mrgreen:

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

Jordan,

I like that reference. Thought this may keep if from going into a black hole some place… :open_mouth:
Style Guide.pdf (56.2 KB)

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