+- +-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Stats ezBlock

Members
Total Members: 125
Latest: Avhagapaphice
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 672
Total Topics: 332
Most Online Today: 4
Most Online Ever: 20
(June 30, 2017, 12:18:50 AM)
Users Online
Members: 0
Guests: 2
Total: 2

Author Topic: Combined WHERE clauses  (Read 2217 times)

MagicSN

  • Administrator
  • Jr. Member
  • *****
  • Posts: 79
    • View Profile
Combined WHERE clauses
« on: December 23, 2012, 08:59:32 AM »
When I have

      foreach pick in hero from Power where "PowerSrc.Arcane"
          perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
        nexteach

and

      foreach pick in hero from WeaponBase where "WepGroup.wgHeavyBl"
          perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
        nexteach

But I want a foreach which checks on BOTH conditions (and'ed) , how do I do this? Also the problem seems to be that part of the information is in the Powers, and part in the WeaponBase, how do I get around this problem?

Thanks.
« Last Edit: December 23, 2012, 09:57:30 AM by MagicSN »

Cryptoknight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Combined WHERE clauses
« Reply #1 on: December 23, 2012, 04:50:32 PM »
I believe the and operator is either & or &&

so you could do something like
Code: [Select]
foreach pick in hero from Power where "PowerSrc.Arcane && WepGroup.wgHeavyBl"
          perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
        nexteach

But in this case I don't know if it would work.  There are no Powers that are in Weapon Groups.

MagicSN

  • Administrator
  • Jr. Member
  • *****
  • Posts: 79
    • View Profile
Re: Combined WHERE clauses
« Reply #2 on: December 23, 2012, 08:37:04 PM »
Yes, the problem is that one of the things comes from Power and one from WeaponBase, and I do not know how I could combine this, or if there is even a solution possible with this scripting language.

Cryptoknight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Combined WHERE clauses
« Reply #3 on: December 23, 2012, 10:59:36 PM »
Why not something like an IF statement inside the for each?
Code: [Select]
Foreach pick in hero from power where "PowerSrc.Arcane"
   IF pick.<don't know the tag>.WepGroup = wgHeavyB1"
       perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
   endif
nexteach

MagicSN

  • Administrator
  • Jr. Member
  • *****
  • Posts: 79
    • View Profile
Re: Combined WHERE clauses
« Reply #4 on: December 24, 2012, 09:50:43 AM »
Why not something like an IF statement inside the for each?
Code: [Select]
Foreach pick in hero from power where "PowerSrc.Arcane"
   IF pick.<don't know the tag>.WepGroup = wgHeavyB1"
       perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
   endif
nexteach

Simple: I was unsure of the syntax to do this ;-)

Cryptoknight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Combined WHERE clauses
« Reply #5 on: December 24, 2012, 03:16:31 PM »
Well I don't know the path to get at the data, but that's the basic syntax :)

MagicSN

  • Administrator
  • Jr. Member
  • *****
  • Posts: 79
    • View Profile
Re: Combined WHERE clauses
« Reply #6 on: December 26, 2012, 12:25:03 PM »
Well I don't know the path to get at the data, but that's the basic syntax :)

I tried this

      foreach pick in hero from Power where "PowerSrc.Arcane"
         if ("pick.WeaponBase.WepGroup = wgHeavyB1")
            perform eachpick.field[pwAtkFeat].modify[+,bonus,""]
         endif
      nexteach

but it said "Error parsing left-side expression in relational comparision". Any idea what is wrong? (I also
tried various placement of "" and () ).


Steffen

Cryptoknight

  • Administrator
  • Sr. Member
  • *****
  • Posts: 260
    • View Profile
Re: Combined WHERE clauses
« Reply #7 on: December 26, 2012, 05:46:25 PM »
Your if... I'd think

Code: [Select]
If(eachpick.WeaponBase.WepGroup="wgHeavyB1")

would be more syntactically correct, but I think this is a question for the Wolflair forums.

MagicSN

  • Administrator
  • Jr. Member
  • *****
  • Posts: 79
    • View Profile
Re: Combined WHERE clauses
« Reply #8 on: December 27, 2012, 08:44:36 AM »
Did not work either. Okay, I will post it to the official forum.

 

+-Recent Topics

Making Utility Powers? by dmayhew469
July 07, 2017, 02:11:16 PM

4e license question by Cryptoknight
June 25, 2017, 09:28:29 PM

Remove/increase limit on Temporary Adjustment value? by Fox Lee
June 22, 2017, 07:30:45 PM

Add the INit modifier for Battle Harness by dmayhew469
June 15, 2017, 08:27:12 PM

Change Attack Ability by dmayhew469
June 15, 2017, 07:57:20 PM

How to allow resistance show up by dmayhew469
June 12, 2017, 04:05:57 PM

Would somebody like to take this over? by dmayhew469
June 09, 2017, 02:02:12 PM

Inherent Bonuses by dmayhew469
June 09, 2017, 01:59:28 PM

No Class or Race options by rkjanik
June 06, 2017, 01:57:21 AM

Spy by Mckinley
May 25, 2017, 02:06:57 AM

Is there a guide out for how to build a race by SAbel
May 05, 2017, 11:59:46 PM

Please read this and weigh in - Issue/Source/Document Version Control System by Charlie
April 27, 2017, 09:54:40 PM

Request Access to the CodePlex System by Charlie
March 03, 2017, 10:47:03 PM

Vampire class by Fox Lee
February 26, 2017, 05:29:29 AM

As we look at Making Card Headers correct colors by dracusmage
February 23, 2017, 03:24:01 PM

Question Involving Twofold Pact for Warlock by dracusmage
February 16, 2017, 02:52:32 AM

Daily Powers by Charlie
February 15, 2017, 06:31:00 PM

Missing Fighter? by dracusmage
February 13, 2017, 10:41:45 PM

Armor at Paragon and above by dracusmage
February 13, 2017, 06:52:16 PM

Help applying bonus damage (x + modifier) to class powers by Fox Lee
January 18, 2017, 06:16:49 AM

Cavalier Summon Steed Patch by Fox Lee
January 15, 2017, 01:00:56 AM

Fey Beast Companions (HotF) by Fox Lee
January 12, 2017, 07:49:08 PM

Has anyone worked with the Warlock (Binder) by SAbel
December 29, 2016, 11:43:17 PM

I will be posting an update soon by SAbel
December 24, 2016, 01:32:41 AM

Weapon Critical damage display by Paragon
December 02, 2016, 06:05:46 PM

Powered by EzPortal