News:

Welcome to the Herolab 4e user added support site.

Main Menu
+-+-

+-User

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

+-Stats ezBlock

Members
Total Members: 177
Latest: Tdotku1911
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 755
Total Topics: 366
Most Online Today: 7
Most Online Ever: 55
(May 13, 2020, 03:23:39 AM)
Users Online
Members: 0
Guests: 4
Total: 4

Combined WHERE clauses

Started by MagicSN, December 23, 2012, 08:59:32 AM

Previous topic - Next topic

MagicSN

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.

Cryptoknight

I believe the and operator is either & or &&

so you could do something like

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

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

Why not something like an IF statement inside the for each?

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

Quote from: Cryptoknight on December 23, 2012, 10:59:36 PM
Why not something like an IF statement inside the for each?

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

Well I don't know the path to get at the data, but that's the basic syntax :)

MagicSN

Quote from: Cryptoknight 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 :)

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

Your if... I'd think


If(eachpick.WeaponBase.WepGroup="wgHeavyB1")


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

MagicSN

Did not work either. Okay, I will post it to the official forum.

+-Recent Topics

4e wont open due to duplicate files error by Fox Lee
April 14, 2024, 01:01:14 AM

Community Data files update 2023-02-16 by Tdotku1911
September 28, 2023, 08:52:54 PM

Errors from last update by jrmcnz
July 17, 2023, 03:30:56 PM

Community Data files update 2023-04-28 by Fox Lee
April 27, 2023, 09:40:45 PM

3rd Party - Zeitgeist character options by Fox Lee
March 25, 2023, 03:21:38 AM

Community Data files update 2023-03-25 by Fox Lee
March 25, 2023, 02:46:40 AM

Our Unofficial Update for Hero Lab 4e by jklagenberg
February 11, 2022, 09:00:52 AM

Kensei Focus - Paragon Path Feature by Charlie
October 21, 2020, 10:13:36 PM

Warlord Scraper Error Fixes by Fox Lee
April 03, 2020, 08:05:51 PM

Herolab 4e Themes Modification by Cryptoknight
July 27, 2019, 02:47:44 AM

Themes Collection by Cryptoknight
July 27, 2019, 02:47:44 AM

Feats Bug Fixes Package by Cryptoknight
July 27, 2019, 02:47:44 AM

Darksun Themes Package by Cryptoknight
July 27, 2019, 02:47:44 AM

Defensive Feats by Cryptoknight
July 27, 2019, 02:47:44 AM

Theme Framework for HeroLab 5 / 4e 4.0 - .HL version by Daphne
July 27, 2019, 02:47:44 AM

2014 09 20 Release by Cryptoknight
July 27, 2019, 02:47:44 AM

2014-09-29 Download by Cryptoknight
July 27, 2019, 02:47:43 AM

2014 11 13 Download by Cryptoknight
July 27, 2019, 02:47:43 AM

Hybrid Battlemind not working as it should by Sean Abel
July 27, 2019, 02:45:49 AM

Please read this and weigh in - Issue/Source/Document Version Control System by nixxrite
March 29, 2019, 07:14:36 AM

Items, Feats and Magic Armour calculations not working by Charlie
March 28, 2019, 01:13:14 PM

Ring Slots by Krigler
March 04, 2019, 06:38:29 AM

Invoker Damage stats by Charlie
September 08, 2018, 07:55:52 PM

Max hit points by Charlie
September 05, 2018, 10:05:12 PM

I have run into a problem with Power class types by Sean Abel
August 18, 2018, 11:43:05 PM

Powered by EzPortal