Just send me your code block, I'll tell you what is wrong with it.

p.
[EMAIL PROTECTED]

-----Original Message-----
From: Garth Penglase [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 12, 2005 7:59 PM
To: witango-talk@witango.com
Subject: Re: Witango-Talk: array help - nested for loop

Thanks Peter, will go through this thoroughly and test with my code to 
see what the difference is.
I still can't figure out why my code is doing one iteration but not the 
rest.
cheers
gp

bbmedia.com.au
p: 0500 527 000
e: [EMAIL PROTECTED]
PO Box 3543 Wamberal NSW 2260
On 13/09/2005, at 9:53 AM, Peter Dobbs wrote:

############# COPY FROM HERE AND PUT IN YOUR DEV STUDIO 
###################

<@! COMMENT="Make Arrays (This could have been results from a database
query">
<@ASSIGN NAME="array1" VALUE='<@ARRAY ROWS="2" COLS="2"
VALUE="1,Hello;2,Goodbye">' SCOPE="request">
<@ASSIGN NAME="array2" VALUE='<@ARRAY ROWS="2" COLS="2" 
VALUE="1,Yes;2,No">'
SCOPE="request">


USING @ROWS LOOP<BR>


<@! COMMENT="Initialize First Counter (Not really necessary except when
sloppy and not sure if a value might be present!)">
<@ASSIGN name=array1Counter value="" scope=request>

<@! COMMENT="Begin Looping Through First Array">
<@ROWS array=array1 scope=request>
        <@! COMMENT="Increment the counter for the First Array">
        <@ASSIGN name=array1Counter value="<@CALC '@@request$array1Counter
+1'>" scope=request>
        <@! COMMENT="Clear the counter for the second array (remember, it
will keep going up to 3 and 4 otherwise!)">
        <@ASSIGN name=array2Counter value="" scope=request>
        <@! COMMENT="Begin Looping Through the second Array">
        <@ROWS array=array2 scope=request>
                <@! COMMENT="Increment the counter for the Second Array">
                <@ASSIGN name=array2Counter value="<@CALC
'@@request$array2Counter +1'>" scope=request>
                
                <@! COMMENT="OUTPUT THE VALUES FROM THE ARRAYS">
                <@VAR array1[@@request$array1Counter,2]
scope="request">:<@VAR array2[@@request$array2Counter,2]
scope="request"><BR>
                <@! COMMENT="You can use the <@CURROW> tag in the nested
loop instead of @@request$array2Counter">
        </@ROWS>
</@ROWS>

<HR>
USING @FOR LOOP<BR>


<@! COMMENT="Initialize First Counter (Not really necessary except when
sloppy and not sure if a value might be present!)">
<@ASSIGN name=array1Counter value="" scope=request>

<@! COMMENT="Begin Looping Through First Array">
<@FOR START="1" STOP="<@NUMROWS array=array1 scope=request>" STEP="1">
        <@! COMMENT="Increment the counter for the First Array">
        <@ASSIGN name=array1Counter value="<@CALC '@@request$array1Counter
+1'>" scope=request>
        <@! COMMENT="Clear the counter for the second array (remember, it
will keep going up to 3 and 4 otherwise!)">
        <@ASSIGN name=array2Counter value="" scope=request>
        <@! COMMENT="Begin Looping Through the second Array">
        <@FOR START="1" STOP="<@NUMROWS array=array2 scope=request>"
STEP="1">
                <@! COMMENT="Increment the counter for the Second Array">
                <@ASSIGN name=array2Counter value="<@CALC
'@@request$array2Counter +1'>" scope=request>
                
                <@! COMMENT="OUTPUT THE VALUES FROM THE ARRAYS">
                <@VAR array1[@@request$array1Counter,2]
scope="request">:<@VAR array2[@@request$array2Counter,2]
scope="request"><BR>
                <@! COMMENT="You can use the <@CURROW> tag in the nested
loop instead of @@request$array2Counter">
        </@FOR>
</@FOR>





############# TO HERE ##########################        

-----Original Message-----
From: Garth Penglase [mailto:[EMAIL PROTECTED]
Sent: Monday, September 12, 2005 7:14 PM
To: witango-talk@witango.com
Subject: Re: Witango-Talk: array help - nested for loop

Do you have an example of that please, Janet?
thanks
garth

bbmedia.com.au
p: 0500 527 000
e: [EMAIL PROTECTED]
PO Box 3543 Wamberal NSW 2260
On 12/09/2005, at 4:49 AM, Quicknote wrote:

I didn't look realy closely at your code. but this reminded me a a
problem I
had.
I was nesting <@ROWS> and they would not work.
So I used the ACTION "ForLoop" for the first loop and then my second
<@ROWS>
( inside this LOOP ACTION) would work fine!
I tested this a few times and found it to be pretty consistent?
Now I use the ACTION "ForLoop" every time I want to have nested LOOPS.
Hope this helps Janet

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to