Re: [Zope] Checking multiple variables existence
Thanks for the response. I could do that but it isn't really getting rid of the original problem. Using my original example I'd be turning this: into: Thereby increasing the lines of code used, albeit in an initially "prettier" format when it gets down to the checking of said variables. I figured if there was an answer for my problem then it'd be an easier method that I just overlooked. If not then I'll just go with it. On Tue, Jan 24, 2012 at 11:43 AM, Jaroslav Lukesh wrote: > Yes, use like that > > > > > > > > - Puvodní zpráva - Od: Justin Dunsworth > > These are required to be set, though.. right? > > > Doing: > > > > > Set > Not Set > > > > works but taking away var_two and I get a NameError: name 'var_two' is not > defined. This is what I'm trying to check is if they exist. Not > particularly looking to match them to anything just yet but rather just to > see if they exist. If they throw an error then it's not working. > > > On Tue, Jan 24, 2012 at 11:08 AM, Jaroslav Lukesh > wrote: > > it works: > > and var5"> > > note1: var5 is string, true when <>'' nor None but must exists > > note2: var5 is int, true when <>0 nor None but must exists > > > > > ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Checking multiple variables existence
Yes, use like that - Puvodní zpráva - Od: Justin Dunsworth These are required to be set, though.. right? Doing: Set Not Set works but taking away var_two and I get a NameError: name 'var_two' is not defined. This is what I'm trying to check is if they exist. Not particularly looking to match them to anything just yet but rather just to see if they exist. If they throw an error then it's not working. On Tue, Jan 24, 2012 at 11:08 AM, Jaroslav Lukesh wrote: it works: and var5"> note1: var5 is string, true when <>'' nor None but must exists note2: var5 is int, true when <>0 nor None but must exists ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Checking multiple variables existence
These are required to be set, though.. right? Doing: Set Not Set works but taking away var_two and I get a NameError: name 'var_two' is not defined. This is what I'm trying to check is if they exist. Not particularly looking to match them to anything just yet but rather just to see if they exist. If they throw an error then it's not working. On Tue, Jan 24, 2012 at 11:08 AM, Jaroslav Lukesh wrote: > it works: > > and var5"> > > note1: var5 is string, true when <>'' nor None but must exists > > note2: var5 is int, true when <>0 nor None but must exists > > > > > > - Puvodní zpráva - Od: Justin Dunsworth > > > Is there any way to check if multiple variables exist in the same if > statement? Right now I am having to writing multiple nested if statements > but can be quite cumbersome... so just looking for an easier way. > > > Currently I'd have to write: > > > > > > > > > > > > When it would be easier to do something like: > > > > > > > > ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Checking multiple variables existence
it works: and var5"> note1: var5 is string, true when <>'' nor None but must exists note2: var5 is int, true when <>0 nor None but must exists - Puvodní zpráva - Od: Justin Dunsworth Is there any way to check if multiple variables exist in the same if statement? Right now I am having to writing multiple nested if statements but can be quite cumbersome... so just looking for an easier way. Currently I'd have to write: When it would be easier to do something like: ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Checking multiple variables existence
Is there any way to check if multiple variables exist in the same if statement? Right now I am having to writing multiple nested if statements but can be quite cumbersome... so just looking for an easier way. Currently I'd have to write: When it would be easier to do something like: I've tried multiple different methods to accomplish this but haven't had any luck... so is there an easier way to check multiple variables existence in the same check? Thanks. ___ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )