[ic] loop-last trouble

Grant emailgrant123b at yahoo.com
Thu Apr 1 14:18:42 EST 2004


I'm trying to use loop-last to make my loops terminate
after a certain condition is met for performance.

The code below saves [loop-code] to a scratch
variable, manipulates it, and then compares that with
a scratch value set before the loop to see if the loop
should be terminated.  You can tell from the code's
output that the scratch variables "sub_category_name"
and "end_loop" are not even being set.  Does anyone
know why this isn't working?  I think I'm taking order
of operations into account here.

[tmpn name="url_part_2"]music_cds[/tmpn]
[loop search="fi=sub_categories/ml=999999/st=db/ra=1"]
[loop-last][calc]
	$Scratch->{sub_category_name} = [loop-code];
	$Scratch->{sub_category_name} = lc
$Scratch->{sub_category_name};
	$Scratch->{sub_category_name} =~ tr/ ./_/d;
	if ($Scratch->{sub_category_name} ==
$Scratch->{url_part_2};) {
		$Scratch->{end_loop} = 1;
	}
	return 1 if $Scratch->{end_loop} == 1;
	return 0;
[/calc][/loop-last]
[loop-code] - [scratch name="sub_category_name"] -
[scratch name="end_loop"]<br />
[/loop]

I have confirmed that [loop-code] returns the expected
output.

- Grant

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/


More information about the interchange-users mailing list