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")) #]

> Thanks so much.
>
> P.S.  I also notice in your FAQ example for perms/combos that the
> end-macro symbol is sometimes, but not always, escaped.  Why?

It suppresses the following newline.  For this example, there are three 'tok'
vaules, so the for loop will iterate three times and the newline after the
'FOR' macro will get emitted three times.  The rest of the text should be
emitted just once.  You probably want to escape the end marker for the FOR.

-------------------------------------------------------------------------
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