• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Validation rule script

  • Thread starter Thread starter esoiset at sbcglobal.net
  • Start date Start date
E

esoiset at sbcglobal.net

Guest
I am having problems with a validation rule script.

The tags I am using:
prStuff.prWarC (General)
prStuff.prKnEx (Unit of knights)
prStuff.prKESen (Knights Hero)

These are defined in the groups tab of an aug file.

The rule I am trying to create is: One unit of knights allowed per
general plus one per knight hero in the army.

What I have done is:

if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
endif

This works to limit the units of knights to one per general. I can
substitute the her for the general in the above equation and it
works too. Where I get confused is when I try to add the hero and
the general together.

I tried:

if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
[prStuff.KESen])) then valid=1
endif

But I got an error message saying: "Syntax error in validation
script for rule on line 1 ->Invalid use of a reserved word in
script."

I also tried:

if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
[prStuff.KESen])) then valid=1
endif

Then the message is: ""Syntax error in validation script for rule on
line 1 -> Reference to undeclared variable."

Any idea what I am doing wrong?

Thanks for your time,

Eric
 
Well, not sure whether my answer will be correct or not as I don't do
anything with AB, but I am a software programmer and your code looks
wrong to me. Assuming your basic code format is correct then


1) Shouldn't this (your code)

if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
endif

be at the very least:

if (tagcount[prStuff.prKnEx] <= [prStuff.prWarC]) then @valid=1
endif

which to me still looks wrong as you should compare tagcounts for both
units of knights and generals thus:

if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.prWarC]) then @valid=1
endif


2) As for combining them together, what are you trying to say? One unit
of knights per general or knight hero? So, an army with 1 general and 2
knights heros could have 3 units of knights, correct? Or an army with 0
generals and 2 knight heros could have 2 units of knights, correct?
That should be something like

if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.prWarC] + tagcount[prStuff.prKESen]) then @valid=1
endif


Perhaps I am totally wrong, but that looks logical to me based upon the
snippet of code you provided.

Tom



thesoi wrote:

>I am having problems with a validation rule script.
>
>The tags I am using:
>prStuff.prWarC (General)
>prStuff.prKnEx (Unit of knights)
>prStuff.prKESen (Knights Hero)
>
>These are defined in the groups tab of an aug file.
>
>The rule I am trying to create is: One unit of knights allowed per
>general plus one per knight hero in the army.
>
>What I have done is:
>
>if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
>endif
>
>This works to limit the units of knights to one per general. I can
>substitute the her for the general in the above equation and it
>works too. Where I get confused is when I try to add the hero and
>the general together.
>
>I tried:
>
>if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
>[prStuff.KESen])) then valid=1
>endif
>
>But I got an error message saying: "Syntax error in validation
>script for rule on line 1 ->Invalid use of a reserved word in
>script."
>
>I also tried:
>
>if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
>[prStuff.KESen])) then valid=1
>endif
>
>Then the message is: ""Syntax error in validation script for rule on
>line 1 -> Reference to undeclared variable."
>
>Any idea what I am doing wrong?
>
>Thanks for your time,
>
>Eric
>
 
Try this instead:

if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
tagcount[prStuff.KESen])) then valid=1
endif


--- thesoi <esoiset@sbcglobal.net> wrote:
>
> I am having problems with a validation rule script.
>
> The tags I am using:
> prStuff.prWarC (General)
> prStuff.prKnEx (Unit of knights)
> prStuff.prKESen (Knights Hero)
>
> These are defined in the groups tab of an aug file.
>
> The rule I am trying to create is: One unit of knights allowed per
> general plus one per knight hero in the army.
>
> What I have done is:
>
> if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> endif
>
> This works to limit the units of knights to one per general. I can
> substitute the her for the general in the above equation and it
> works too. Where I get confused is when I try to add the hero and
> the general together.
>
> I tried:
>
> if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> [prStuff.KESen])) then valid=1
> endif
>
> But I got an error message saying: "Syntax error in validation
> script for rule on line 1 ->Invalid use of a reserved word in
> script."
>
> I also tried:
>
> if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> [prStuff.KESen])) then valid=1
> endif
>
> Then the message is: ""Syntax error in validation script for rule on
> line 1 -> Reference to undeclared variable."
>
> Any idea what I am doing wrong?
>
> Thanks for your time,
>
> Eric
>
>
>
>
>
> To unsubscribe from this group, email
>
> armybuilder-unsubscribe@yahoogroups.com
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


=====
WF6 Army Builder File Manager
Direwolf FAQ Council - Army Builder Liaison
-
Warhammer Club - Vancouver, BC
http://www.WCP-Vancouver.com




__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
 
I tried that, now the message I get is:
"Syntax error in validation script on line 1.
Error Parsing Left Side expression in relational comparison."

This is what I have in the rule:
if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
tagcount[prStuff.KESen])) then
@valid=1
endif

If I remove the middle set of parentheses:

This is what I have in the rule:
if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
tagcount[prStuff.KESen]) then
@valid=1
endif
I get no error message, but the prStuff.WarC doesn't seem to be
counted. By that, I mean I can take a general and I get a validation
error if I take a unit of knigts. The validation error goes away if I
then choose a knight hero. This rule only seems to count the last
tagcount expression and ignores the first tagcount after the <=.

Any ideas?
Thanks for the input you have given so far.
Eric

--- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...> wrote:
> Try this instead:
>
> if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> tagcount[prStuff.KESen])) then valid=1
> endif
>
>
> --- thesoi <esoiset@s...> wrote:
> >
> > I am having problems with a validation rule script.
> >
> > The tags I am using:
> > prStuff.prWarC (General)
> > prStuff.prKnEx (Unit of knights)
> > prStuff.prKESen (Knights Hero)
> >
> > These are defined in the groups tab of an aug file.
> >
> > The rule I am trying to create is: One unit of knights allowed per
> > general plus one per knight hero in the army.
> >
> > What I have done is:
> >
> > if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> > endif
> >
> > This works to limit the units of knights to one per general. I can
> > substitute the her for the general in the above equation and it
> > works too. Where I get confused is when I try to add the hero and
> > the general together.
> >
> > I tried:
> >
> > if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> > [prStuff.KESen])) then valid=1
> > endif
> >
> > But I got an error message saying: "Syntax error in validation
> > script for rule on line 1 ->Invalid use of a reserved word in
> > script."
> >
> > I also tried:
> >
> > if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> > [prStuff.KESen])) then valid=1
> > endif
> >
> > Then the message is: ""Syntax error in validation script for rule on
> > line 1 -> Reference to undeclared variable."
> >
> > Any idea what I am doing wrong?
> >
> > Thanks for your time,
> >
> > Eric
> >
> >
> >
> >
> >
> > To unsubscribe from this group, email
> >
> > armybuilder-unsubscribe@yahoogroups.com
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> =====
> WF6 Army Builder File Manager
> Direwolf FAQ Council - Army Builder Liaison
> -
> Warhammer Club - Vancouver, BC
> http://www.WCP-Vancouver.com
>
>
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
 
Ok, have you tried

if (tagcount[prStuff.KnEx] <= (tagcount[prStuff.WarC] +
tagcount[prStuff.KESen])) then
@valid=1
endif

or

if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.prWarC] +
tagcount[prStuff.prKESen])) then
@valid=1
endif

Tom



thesoi wrote:

>I tried that, now the message I get is:
>"Syntax error in validation script on line 1.
>Error Parsing Left Side expression in relational comparison."
>
>This is what I have in the rule:
>if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
>tagcount[prStuff.KESen])) then
>@valid=1
>endif
>
>If I remove the middle set of parentheses:
>
>This is what I have in the rule:
>if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
>tagcount[prStuff.KESen]) then
>@valid=1
>endif
>I get no error message, but the prStuff.WarC doesn't seem to be
>counted. By that, I mean I can take a general and I get a validation
>error if I take a unit of knigts. The validation error goes away if I
>then choose a knight hero. This rule only seems to count the last
>tagcount expression and ignores the first tagcount after the <=.
>
>Any ideas?
>Thanks for the input you have given so far.
>Eric
>
>--- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...> wrote:
>
>
>>Try this instead:
>>
>>if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
>>tagcount[prStuff.KESen])) then valid=1
>>endif
>>
>>
>>--- thesoi <esoiset@s...> wrote:
>>
>>
>>>I am having problems with a validation rule script.
>>>
>>>The tags I am using:
>>>prStuff.prWarC (General)
>>>prStuff.prKnEx (Unit of knights)
>>>prStuff.prKESen (Knights Hero)
>>>
>>>These are defined in the groups tab of an aug file.
>>>
>>>The rule I am trying to create is: One unit of knights allowed per
>>>general plus one per knight hero in the army.
>>>
>>>What I have done is:
>>>
>>>if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
>>>endif
>>>
>>>This works to limit the units of knights to one per general. I can
>>>substitute the her for the general in the above equation and it
>>>works too. Where I get confused is when I try to add the hero and
>>>the general together.
>>>
>>>I tried:
>>>
>>>if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
>>>[prStuff.KESen])) then valid=1
>>>endif
>>>
>>>But I got an error message saying: "Syntax error in validation
>>>script for rule on line 1 ->Invalid use of a reserved word in
>>>script."
>>>
>>>I also tried:
>>>
>>>if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
>>>[prStuff.KESen])) then valid=1
>>>endif
>>>
>>>Then the message is: ""Syntax error in validation script for rule on
>>>line 1 -> Reference to undeclared variable."
>>>
>>>Any idea what I am doing wrong?
>>>
>>>Thanks for your time,
>>>
>>>Eric
>>>
>>>
>>>
>>>
>>>
>>>To unsubscribe from this group, email
>>>
>>>armybuilder-unsubscribe@yahoogroups.com
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>=====
>>WF6 Army Builder File Manager
>>Direwolf FAQ Council - Army Builder Liaison
>>-
>>Warhammer Club - Vancouver, BC
>>http://www.WCP-Vancouver.com
>>
>>
>>
>>
>>__________________________________
>>Celebrate Yahoo!'s 10th Birthday!
>>Yahoo! Netrospective: 100 Moments of the Web
>>http://birthday.yahoo.com/netrospective/
>>
>>
>
>
>
>
>
>To unsubscribe from this group, email
>
>armybuilder-unsubscribe@yahoogroups.com
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>

--
NOTICE: This electronic message (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521. It is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error and then destroy the communication. Thank You.



[Non-text portions of this message have been removed]
 
I have tried those. As soon as the open parentheses after the <= go
in, I get the "Error Parsing Left Side expression in relational
comparison." error.
In your first example, I think I need the pr in front of KnEx, WarC
and KESen, as that is the name of the tag variable.

Thanks for the reply,
Eric

--- In armybuilder@yahoogroups.com, "Thomas J. Willard" <tomw@i...> wrote:
> Ok, have you tried
>
> if (tagcount[prStuff.KnEx] <= (tagcount[prStuff.WarC] +
> tagcount[prStuff.KESen])) then
> @valid=1
> endif
>
> or
>
> if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.prWarC] +
> tagcount[prStuff.prKESen])) then
> @valid=1
> endif
>
> Tom
>
>
>
> thesoi wrote:
>
> >I tried that, now the message I get is:
> >"Syntax error in validation script on line 1.
> >Error Parsing Left Side expression in relational comparison."
> >
> >This is what I have in the rule:
> >if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> >tagcount[prStuff.KESen])) then
> >@valid=1
> >endif
> >
> >If I remove the middle set of parentheses:
> >
> >This is what I have in the rule:
> >if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
> >tagcount[prStuff.KESen]) then
> >@valid=1
> >endif
> >I get no error message, but the prStuff.WarC doesn't seem to be
> >counted. By that, I mean I can take a general and I get a validation
> >error if I take a unit of knigts. The validation error goes away if I
> >then choose a knight hero. This rule only seems to count the last
> >tagcount expression and ignores the first tagcount after the <=.
> >
> >Any ideas?
> >Thanks for the input you have given so far.
> >Eric
> >
> >--- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...> wrote:
> >
> >
> >>Try this instead:
> >>
> >>if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> >>tagcount[prStuff.KESen])) then valid=1
> >>endif
> >>
> >>
> >>--- thesoi <esoiset@s...> wrote:
> >>
> >>
> >>>I am having problems with a validation rule script.
> >>>
> >>>The tags I am using:
> >>>prStuff.prWarC (General)
> >>>prStuff.prKnEx (Unit of knights)
> >>>prStuff.prKESen (Knights Hero)
> >>>
> >>>These are defined in the groups tab of an aug file.
> >>>
> >>>The rule I am trying to create is: One unit of knights allowed per
> >>>general plus one per knight hero in the army.
> >>>
> >>>What I have done is:
> >>>
> >>>if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> >>>endif
> >>>
> >>>This works to limit the units of knights to one per general. I can
> >>>substitute the her for the general in the above equation and it
> >>>works too. Where I get confused is when I try to add the hero and
> >>>the general together.
> >>>
> >>>I tried:
> >>>
> >>>if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> >>>[prStuff.KESen])) then valid=1
> >>>endif
> >>>
> >>>But I got an error message saying: "Syntax error in validation
> >>>script for rule on line 1 ->Invalid use of a reserved word in
> >>>script."
> >>>
> >>>I also tried:
> >>>
> >>>if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> >>>[prStuff.KESen])) then valid=1
> >>>endif
> >>>
> >>>Then the message is: ""Syntax error in validation script for rule on
> >>>line 1 -> Reference to undeclared variable."
> >>>
> >>>Any idea what I am doing wrong?
> >>>
> >>>Thanks for your time,
> >>>
> >>>Eric
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>To unsubscribe from this group, email
> >>>
> >>>armybuilder-unsubscribe@yahoogroups.com
> >>>Yahoo! Groups Links
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>=====
> >>WF6 Army Builder File Manager
> >>Direwolf FAQ Council - Army Builder Liaison
> >>-
> >>Warhammer Club - Vancouver, BC
> >>http://www.WCP-Vancouver.com
> >>
> >>
> >>
> >>
> >>__________________________________
> >>Celebrate Yahoo!'s 10th Birthday!
> >>Yahoo! Netrospective: 100 Moments of the Web
> >>http://birthday.yahoo.com/netrospective/
> >>
> >>
> >
> >
> >
> >
> >
> >To unsubscribe from this group, email
> >
> >armybuilder-unsubscribe@yahoogroups.com
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> NOTICE: This electronic message (including attachments) is covered
by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521. It
is confidential and may be legally privileged. If you are not the
intended recipient, you are hereby notified that any retention,
dissemination, distribution, or copying of this communication is
strictly prohibited. Please reply to the sender that you have
received the message in error and then destroy the communication.
Thank You.
>
>
>
> [Non-text portions of this message have been removed]
 
I've run into these same problems and gotten around them by assigning
variables before the if-then test. Try this below:

var numprKnEx as number
var numprWarC as number
var prKESen as number

if (numprKnEx <= (numprWarC + numprKESen)) then
@valid=1
endif

If that doesn't work, do your addition before the test:

var numprKnEx as number
var numprWarC as number
var numprKESen as number
var numTotal as number

numTotal = numprWarC + numprKESen

if (numprKnEx <= numTotal) then
@valid=1
endif

A bit klunky, but that seems to work most of the time. I don't know
why the other doesn't work (mostly I thought it was me getting the
syntax wrong) but this is how I've gotten around it in my FOW-rgmt
files I'm working on.

Ted

--- In armybuilder@yahoogroups.com, "thesoi" <esoiset@s...> wrote:
>
> I have tried those. As soon as the open parentheses after the <= go
> in, I get the "Error Parsing Left Side expression in relational
> comparison." error.
> In your first example, I think I need the pr in front of KnEx, WarC
> and KESen, as that is the name of the tag variable.
>
> Thanks for the reply,
> Eric
>
> --- In armybuilder@yahoogroups.com, "Thomas J. Willard" <tomw@i...>
wrote:
> > Ok, have you tried
> >
> > if (tagcount[prStuff.KnEx] <= (tagcount[prStuff.WarC] +
> > tagcount[prStuff.KESen])) then
> > @valid=1
> > endif
> >
> > or
> >
> > if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.prWarC] +
> > tagcount[prStuff.prKESen])) then
> > @valid=1
> > endif
> >
> > Tom
> >
> >
> >
> > thesoi wrote:
> >
> > >I tried that, now the message I get is:
> > >"Syntax error in validation script on line 1.
> > >Error Parsing Left Side expression in relational comparison."
> > >
> > >This is what I have in the rule:
> > >if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> > >tagcount[prStuff.KESen])) then
> > >@valid=1
> > >endif
> > >
> > >If I remove the middle set of parentheses:
> > >
> > >This is what I have in the rule:
> > >if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
> > >tagcount[prStuff.KESen]) then
> > >@valid=1
> > >endif
> > >I get no error message, but the prStuff.WarC doesn't seem to be
> > >counted. By that, I mean I can take a general and I get a validation
> > >error if I take a unit of knigts. The validation error goes away if I
> > >then choose a knight hero. This rule only seems to count the last
> > >tagcount expression and ignores the first tagcount after the <=.
> > >
> > >Any ideas?
> > >Thanks for the input you have given so far.
> > >Eric
> > >
> > >--- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...>
wrote:
> > >
> > >
> > >>Try this instead:
> > >>
> > >>if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> > >>tagcount[prStuff.KESen])) then valid=1
> > >>endif
> > >>
> > >>
> > >>--- thesoi <esoiset@s...> wrote:
> > >>
> > >>
> > >>>I am having problems with a validation rule script.
> > >>>
> > >>>The tags I am using:
> > >>>prStuff.prWarC (General)
> > >>>prStuff.prKnEx (Unit of knights)
> > >>>prStuff.prKESen (Knights Hero)
> > >>>
> > >>>These are defined in the groups tab of an aug file.
> > >>>
> > >>>The rule I am trying to create is: One unit of knights allowed per
> > >>>general plus one per knight hero in the army.
> > >>>
> > >>>What I have done is:
> > >>>
> > >>>if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> > >>>endif
> > >>>
> > >>>This works to limit the units of knights to one per general. I can
> > >>>substitute the her for the general in the above equation and it
> > >>>works too. Where I get confused is when I try to add the hero and
> > >>>the general together.
> > >>>
> > >>>I tried:
> > >>>
> > >>>if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> > >>>[prStuff.KESen])) then valid=1
> > >>>endif
> > >>>
> > >>>But I got an error message saying: "Syntax error in validation
> > >>>script for rule on line 1 ->Invalid use of a reserved word in
> > >>>script."
> > >>>
> > >>>I also tried:
> > >>>
> > >>>if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> > >>>[prStuff.KESen])) then valid=1
> > >>>endif
> > >>>
> > >>>Then the message is: ""Syntax error in validation script for
rule on
> > >>>line 1 -> Reference to undeclared variable."
> > >>>
> > >>>Any idea what I am doing wrong?
> > >>>
> > >>>Thanks for your time,
> > >>>
> > >>>Eric
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>To unsubscribe from this group, email
> > >>>
> > >>>armybuilder-unsubscribe@yahoogroups.com
> > >>>Yahoo! Groups Links
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>=====
> > >>WF6 Army Builder File Manager
> > >>Direwolf FAQ Council - Army Builder Liaison
> > >>-
> > >>Warhammer Club - Vancouver, BC
> > >>http://www.WCP-Vancouver.com
> > >>
> > >>
> > >>
> > >>
> > >>__________________________________
> > >>Celebrate Yahoo!'s 10th Birthday!
> > >>Yahoo! Netrospective: 100 Moments of the Web
> > >>http://birthday.yahoo.com/netrospective/
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> > >To unsubscribe from this group, email
> > >
> > >armybuilder-unsubscribe@yahoogroups.com
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> > --
> > NOTICE: This electronic message (including attachments) is covered
> by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521. It
> is confidential and may be legally privileged. If you are not the
> intended recipient, you are hereby notified that any retention,
> dissemination, distribution, or copying of this communication is
> strictly prohibited. Please reply to the sender that you have
> received the message in error and then destroy the communication.
> Thank You.
> >
> >
> >
> > [Non-text portions of this message have been removed]
 
create a number var before hand and assign the value of
(tagcount[prStuff.WarC] + tagcount[prStuff.KESen]) to it and then use
that in the comparison, I dont think AB does complex relational arguments

--- In armybuilder@yahoogroups.com, "thesoi" <esoiset@s...> wrote:
>
> I tried that, now the message I get is:
> "Syntax error in validation script on line 1.
> Error Parsing Left Side expression in relational comparison."
>
> This is what I have in the rule:
> if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> tagcount[prStuff.KESen])) then
> @valid=1
> endif
>
> If I remove the middle set of parentheses:
>
> This is what I have in the rule:
> if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
> tagcount[prStuff.KESen]) then
> @valid=1
> endif
> I get no error message, but the prStuff.WarC doesn't seem to be
> counted. By that, I mean I can take a general and I get a validation
> error if I take a unit of knigts. The validation error goes away if I
> then choose a knight hero. This rule only seems to count the last
> tagcount expression and ignores the first tagcount after the <=.
>
> Any ideas?
> Thanks for the input you have given so far.
> Eric
>
> --- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...> wrote:
> > Try this instead:
> >
> > if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> > tagcount[prStuff.KESen])) then valid=1
> > endif
> >
> >
> > --- thesoi <esoiset@s...> wrote:
> > >
> > > I am having problems with a validation rule script.
> > >
> > > The tags I am using:
> > > prStuff.prWarC (General)
> > > prStuff.prKnEx (Unit of knights)
> > > prStuff.prKESen (Knights Hero)
> > >
> > > These are defined in the groups tab of an aug file.
> > >
> > > The rule I am trying to create is: One unit of knights allowed per
> > > general plus one per knight hero in the army.
> > >
> > > What I have done is:
> > >
> > > if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> > > endif
> > >
> > > This works to limit the units of knights to one per general. I can
> > > substitute the her for the general in the above equation and it
> > > works too. Where I get confused is when I try to add the hero and
> > > the general together.
> > >
> > > I tried:
> > >
> > > if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> > > [prStuff.KESen])) then valid=1
> > > endif
> > >
> > > But I got an error message saying: "Syntax error in validation
> > > script for rule on line 1 ->Invalid use of a reserved word in
> > > script."
> > >
> > > I also tried:
> > >
> > > if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> > > [prStuff.KESen])) then valid=1
> > > endif
> > >
> > > Then the message is: ""Syntax error in validation script for
rule on
> > > line 1 -> Reference to undeclared variable."
> > >
> > > Any idea what I am doing wrong?
> > >
> > > Thanks for your time,
> > >
> > > Eric
> > >
> > >
> > >
> > >
> > >
> > > To unsubscribe from this group, email
> > >
> > > armybuilder-unsubscribe@yahoogroups.com
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> > =====
> > WF6 Army Builder File Manager
> > Direwolf FAQ Council - Army Builder Liaison
> > -
> > Warhammer Club - Vancouver, BC
> > http://www.WCP-Vancouver.com
> >
> >
> >
> >
> > __________________________________
> > Celebrate Yahoo!'s 10th Birthday!
> > Yahoo! Netrospective: 100 Moments of the Web
> > http://birthday.yahoo.com/netrospective/
 
Thanks to you two, I was able to make it work with this formula:

var numKEval as number

numKEval = tagcount[prStuff.prWarCast]+tagcount[prStuff.prKESen]

if (tagcount[prStuff.prKnEx] <= numKEval) then
@valid = 1
endif

Works perfect now! Thanks harkan and Ted.

Eric

--- In armybuilder@yahoogroups.com, "harkanironfist" <dom@w...> wrote:
>
> create a number var before hand and assign the value of
> (tagcount[prStuff.WarC] + tagcount[prStuff.KESen]) to it and then use
> that in the comparison, I dont think AB does complex relational
arguments
>
> --- In armybuilder@yahoogroups.com, "thesoi" <esoiset@s...> wrote:
> >
> > I tried that, now the message I get is:
> > "Syntax error in validation script on line 1.
> > Error Parsing Left Side expression in relational comparison."
> >
> > This is what I have in the rule:
> > if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> > tagcount[prStuff.KESen])) then
> > @valid=1
> > endif
> >
> > If I remove the middle set of parentheses:
> >
> > This is what I have in the rule:
> > if (tagcount[prStuff.prKnEx] <= tagcount[prStuff.WarC] +
> > tagcount[prStuff.KESen]) then
> > @valid=1
> > endif
> > I get no error message, but the prStuff.WarC doesn't seem to be
> > counted. By that, I mean I can take a general and I get a validation
> > error if I take a unit of knigts. The validation error goes away if I
> > then choose a knight hero. This rule only seems to count the last
> > tagcount expression and ignores the first tagcount after the <=.
> >
> > Any ideas?
> > Thanks for the input you have given so far.
> > Eric
> >
> > --- In armybuilder@yahoogroups.com, Mark Handford <mach_5@r...> wrote:
> > > Try this instead:
> > >
> > > if (tagcount[prStuff.prKnEx] <= (tagcount[prStuff.WarC] +
> > > tagcount[prStuff.KESen])) then valid=1
> > > endif
> > >
> > >
> > > --- thesoi <esoiset@s...> wrote:
> > > >
> > > > I am having problems with a validation rule script.
> > > >
> > > > The tags I am using:
> > > > prStuff.prWarC (General)
> > > > prStuff.prKnEx (Unit of knights)
> > > > prStuff.prKESen (Knights Hero)
> > > >
> > > > These are defined in the groups tab of an aug file.
> > > >
> > > > The rule I am trying to create is: One unit of knights allowed
per
> > > > general plus one per knight hero in the army.
> > > >
> > > > What I have done is:
> > > >
> > > > if (tagcount[prStuff.prKnEx] <= [prStuffWarC]) then @valid=1
> > > > endif
> > > >
> > > > This works to limit the units of knights to one per general. I
can
> > > > substitute the her for the general in the above equation and it
> > > > works too. Where I get confused is when I try to add the hero and
> > > > the general together.
> > > >
> > > > I tried:
> > > >
> > > > if (tagcount[prStuff.prKnEx] <= tagcount([prStuff.WarC]+
> > > > [prStuff.KESen])) then valid=1
> > > > endif
> > > >
> > > > But I got an error message saying: "Syntax error in validation
> > > > script for rule on line 1 ->Invalid use of a reserved word in
> > > > script."
> > > >
> > > > I also tried:
> > > >
> > > > if (tagcount[prStuff.prKnEx]) <= (tagcount([prStuff.WarC]+
> > > > [prStuff.KESen])) then valid=1
> > > > endif
> > > >
> > > > Then the message is: ""Syntax error in validation script for
> rule on
> > > > line 1 -> Reference to undeclared variable."
> > > >
> > > > Any idea what I am doing wrong?
> > > >
> > > > Thanks for your time,
> > > >
> > > > Eric
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > To unsubscribe from this group, email
> > > >
> > > > armybuilder-unsubscribe@yahoogroups.com
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > =====
> > > WF6 Army Builder File Manager
> > > Direwolf FAQ Council - Army Builder Liaison
> > > -
> > > Warhammer Club - Vancouver, BC
> > > http://www.WCP-Vancouver.com
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Celebrate Yahoo!'s 10th Birthday!
> > > Yahoo! Netrospective: 100 Moments of the Web
> > > http://birthday.yahoo.com/netrospective/
 
Back
Top