Complex Layout Problem
livfoss at blueyonder.co.uk
Fri Oct 31 17:34:17 EST 2003
On Thu, 30 Oct 2003 13:53:23 -0600, Bojsza <gbojsza at mac.com> wrote:
At 16:22 -0500 31/10/03, use-revolution-request at lists.runrev.com wrote:
>Has anyone ever had to layout an interface that the user can input
>various values into fields and build a logical AND, OR and NOT string?
>For example I have two fields sAddr and dAddr in which the user can
>enter any ip address they want. But they also can define a logical
>statement from these fields:
>Example: The user enters sAddr 10.10.2.3 dAddr 22.214.171.124 and wants this
>combination OR sAddr 126.96.36.199 AND NOT dAddr 188.8.131.52
>This builds the expression
>(sAddr 10.10.2.3 AND dAddr 184.108.40.206) OR (sAddr 220.127.116.11 NOT dAddr
>The grouping is key and must be maintained as the user continues to add
>My thought was to have three identical groups of fields...one for each
>logical operator. Allow the user to enter his first requirements, build
>the expression and then see if they have another set of requirements.
>Is the most efficient way to approach this? Sorry this is not a
>Revolution specific problem but I was hoping the board would still have
Not sure if I entirely understand where your problem lies, but
couldn't you lay out a rectangular area in which you have a structure
<field> <option list> <field> <option list> <field> etc
Where the items in the option lists are the logical operators (OR,
AND and any other more fancy ones you may wish to include, including
inversion - NOT).
Then the user picks an option, which stays put after being selected,
so he/she sees the logical expression laid out on the screen. I'm
doing something a little bit like this to allow my user to program a
finite state automaton - well only a little bit, but the option lists
have proved the key element.
How you actually operate on the expression(s) depends of course on
what you want the result to look like, but it appears that a very
limited amount of scripting would be needed to interpret the strings
and apply the operators.
Hope I didn't misunderstand completely
Graham Samuel / The Living Fossil Co. / UK & France
More information about the Use-livecode