On Jan 21, 2008 10:29 AM, Bruce Korb <[EMAIL PROTECTED]> wrote:
> Hi Tom,
>
> On Jan 21, 2008 8:15 AM, Tom Browder <[EMAIL PROTECTED]> wrote:
> > Bruce, I'm having no luck extracting a subvalue and testing it.
> >
> > In my def file I have a series of values something like this:
> >
> > tok = { kvalue = not; cvalue = LEFT; prec = token; nbr = 259; };
> > tok = { kvalue = not; cvalue = GEN3; prec = token; nbr = 260; };
> > tok = { kvalue = not; cvalue = GEN4; prec = left;  nbr = 522; };
> >
> > In my template file I only want to list values of 'tok' whose 'prec' value 
> > is
> > != 'token'.  I've tried the following (with 'prec', 'prec, and "prec") but 
> > it
> > doesn't exclude any values:
> >
> > [# FOR tok #]
> > [# IF (not (== (get 'prec') "token")) #]
> > %[#prec#] [#cvalue#][# ENDIF #][# ENDFOR tok #]
> >
> > Would you please help me?
>
> Guile is probably happy with whatever it is that (get 'prec') winds up
> returning.  My function that handles the == operator sees an empty
> string and says it isn't equal to the string "token".  It might work
> better to use double quotes around the string, thus:
>
> [# IF (not (== (get "prec") "token")) #]

The correct answer appears to be (note the added '.')::

[# IF (not (== (get ".prec") "token")) #]

The AutoGen manual needs to show this example since it currently
implies that either syntax works.

Adding a description of how newlines are handled in the template file
=> generated file would also be helpful.

-Tom

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Autogen-users mailing list
Autogen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/autogen-users

Reply via email to