[ic] Scripting inside IC Tags

Barry Treahy, Jr. interchange-users@icdevgroup.org
Thu Sep 19 19:10:01 2002


Frank wrote:

>Hello List, 
>
>after getting caught in the mailinglist-archives without result
>here now my as I think simple question:
>
>I want to randomize a loop search within a page every time the page
>will be refreshed. So I only have to change the search-value 
>(5 possible values a-e) within the loop-search.
>
>I tried the following: 
>
>1. perl version
>	[loop search="se=
>		[perl interpolate=1]
>		@tmp = (a,b,c,d,e)
>		srand();
>		$num = int(rand 5);
>		$out = $tmp[$num];
>		$out;
>		[/perl]
>	/sf=cat/ml=1"]
>	
> --> nothing happens, even with generating the hole [loop search....]
>     by the script -> no output (seems to me the rand function
>     is not supported.(?))
>
>  
>
The JS path is dead as it executes on the browser and not the server.  Is there a reason you don't use the random parameter for loop?  Either create a scratch variable from the results which the search loop uses or nest the two?

Barry

-- 

Barry Treahy, Jr  *  Midwest Microwave  *  Vice President & CIO 

E-mail: Treahy@mmaz.com * Phone: 480/314-1320 * FAX: 480/661-7028