bugBattle for Wesnoth - Bugs: bug #11011, Enable 'find_in' for [variable]

 
 
Show feedback again

bug #11011: Enable 'find_in' for [variable]

Submitted by:  Piotr Cychowski <cycholka>
Submitted on:  Fri 08 Feb 2008 01:01:29 PM UTC  
 
Category: Feature RequestSeverity: 1 - Wish
Priority: 1 - LaterItem Group: WML
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: post 1.4Operating System: any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 29 Jan 2012 09:47:09 PM UTC, comment #4:

Removing Postponed status and deassigning from cib, who isn't active anymore.

Ignacio R. Morelle <shadowmaster>
Project Administrator
Sat 09 Feb 2008 02:31:49 PM UTC, comment #3:

Well, WML is not SQL, SQL syntax makes no sense in this case.

Your syntax doesn't even work, because there aren't arrays of scalars, there are only arrays of containers.

$foobar[] = {'aaa','something','etc'}

would have to be

$foobar[] = {['value':'aaa'],['value':'something'],['value':'etc']}

Thus you'd need to specify the key 'value'

[variable]
name=foo
find_in=foobar
key=value
[/variable]

And now the only difference to my suggestion is, that with my syntax you'd write

[variable]
find_in=foobar
key=value
equals=$foo
[/variable]

Anonymous
Fri 08 Feb 2008 10:55:20 PM UTC, comment #2:

I was rather thinking of something along SQL syntax regarding keyword IN

So for example if $foo = 'something' and $foobar[] = {'aaa','something','etc'}

[variable]
name=foo
find_in=foobar
[/variable]

would evaluate to true.

Piotr Cychowski <cycholka>
Project Member
Fri 08 Feb 2008 01:12:08 PM UTC, comment #1:

You could be a bit more specific, I need to guess here pretty much. Do you mean this?

[if]
[variable]
find_in=my_array
key=x
equals=1
[/variable]
[/if]

Well, that might not be the best syntax, but I can't think of something better.

Christian Bielert <cib>
Project Member
Fri 08 Feb 2008 01:01:29 PM UTC, original submission:

Would allow to cut some akward filtering when wanting to check if a variable exists in a given set.

Piotr Cychowski <cycholka>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by shadowmaster (Posted a comment)
  • -unavailable- added by cib (Posted a comment)
  • -unavailable- added by cycholka (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 29 Jan 2012 09:47:09 PM UTCshadowmasterStatusPostponed=>None
      Assigned tocib=>None
    Fri 08 Feb 2008 01:13:18 PM UTCcibStatusNone=>Postponed
      Assigned toNone=>cib
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup