[ic] [if scratch...]

Mat Jones - booksellersolutions.com mat@booksellersolutions.com
Thu, 1 Mar 2001 10:10:09 -0800


I was trouble shooting for 2 hours yesterday. I printed the value of scratch
count1 to the page which was 30.  When I replaced the [scratch count1] with
a real number e.g [loop-alternate 30] instead of [loop-alternate [scratch
count1]]  it worked fine... just doesnt seem to like the [scratch] variables
within loop alternate.

----- Original Message -----
From: "Ed LaFrance" <edl@newmediaems.com>
To: <interchange-users@lists.akopia.com>
Sent: Thursday, March 01, 2001 9:52 AM
Subject: Re: [ic] [if scratch...]


> At 09:34 AM 03/01/2001 -0800, you wrote:
> >I tried both methods you suggested, but it still didnt read the [scratch
> >count1] variable.
> >With the loop-alternate it just printed [loop-alternate [scratch count1]]
to
> >the screen.
> >Any other suggestions?
> >
> >Thanks
> >
> >Mat
>
> Yes: read the docs for [loop-alternate] usage.  Put [scratch count] and
> [scratch count1] on your page, inside and outside both loops, so you can
> see what the contain at each step, and is it what you expect?  Use some
> troubleshooting techniques.
>
> - Ed L.
>
>
>
>
>
> >----- Original Message -----
> >From: "Ed LaFrance" <edl@newmediaems.com>
> >To: <interchange-users@lists.akopia.com>
> >Sent: Thursday, March 01, 2001 9:09 AM
> >Subject: Re: [ic] [if scratch...]
> >
> >
> > > At 08:01 PM 02/28/2001 -0800, you wrote:
> > > >Hi,
> > > >
> > > >I am trying to compare scratch values in an if/elsif statement, and
> > > >tried the following code. I cannot get this to work. What I am trying
do
> > > >to is get the results of a loop search to organize into two columns.
The
> > > >first section is a loop to count the number of items in a list. if I
> > > >replace the '[scratch count1]' variable with a number, this works
fine,
> > > >it just doesnt seem to recognise the [scratch] tag as part of the IF
tag
> > > >evaluation. Can anybody help me out.
> > > >
> > > >[loop.....]
> > > >[seti count1][calc][scratch count1] + 1[/calc][/seti]
> > > >[/loop]
> > > >[seti count1][calc][scratch count1] / 2[/calc][/seti]
> > > >[seti count][/seti]
> > > ><table><tr><td>
> > > >[loop ....]
> > > >[seti count][calc][scratch count]  + 1[/calc][/seti]
> > > >[if scratch count < [scratch count1]] [loop-code]<br>
> > > >[elsif scratch count == [scratch count1]] [loop-code]<br></td><td>
> > > >[/elsif]
> > > >[/else] [loop-code]<br>[/else][/if]
> > > >[/loop]
> > > ></td></tr></table>
> > > >
> > > >Thanks
> > >
> > > In these situations it is best to used the named syntax for the
[if..]:
> > >
> > > [if type="scratch" term="count" op="<" compare="[scratch count1]"]
> > > ..
> > > [elsif type="scratch term="count" op="==" compare="[scratch count1]"]
> > > ...
> > > [/elsif]
> > > [else]...[/else]
> > > [/if]
> > >
> > > BTW - Have you looked into [loop-alternate]? You could simplify this
code
> > > considerably.  [if..]'s in looping code can slow page load time
> >dramantically.
> > >
> > > - Ed L.
> > >
> > >
> > > _______________________________________________
> > > Interchange-users mailing list
> > > Interchange-users@lists.akopia.com
> > > http://lists.akopia.com/mailman/listinfo/interchange-users
> >
> >
> >_______________________________________________
> >Interchange-users mailing list
> >Interchange-users@lists.akopia.com
> >http://lists.akopia.com/mailman/listinfo/interchange-users
>
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users