Introduction Installation Beginning Admin Quick Ref FTP Server SMTP Server Database Security
Statements Objects String Parsing Events Queues Samples Special names Error Handling Accessories   Back
Statements>Loop Statements>Properties>Count
Caravan Business Server>Help>Statements>Loop Statements> Properties Count
Name Count
Text Index of the current loop
Sample
<HTML>
<BODY>
<CARAVAN>
var temp
temp(delim)=","
temp(name)="John,Mary,Chris"
loop ctr (temp(name(00)))
      ctr(counter);") ";temp(name(ctr(count)));
repeat ctr 100
</CARAVAN>
</BODY>
</HTML>
  
Caravan Business Server>Help>Statements>Loop Statements> Properties> Counter
Name Counter
Text           Numeric value used as a loop counter   
Sample
<HTML>
<BODY>
<CARAVAN>
var temp
temp(delim)=","
temp(name)="John,Mary,Chris"
loop ctr (temp(name(00)))
      ctr(counter);") ";temp(name(ctr(count)));
repeat ctr 100
</CARAVAN>
</BODY>
</HTML>
  
Caravan Business Server>Help>Statements>Loop Statements> Properties> Break
Name Break
Text   
     Used to terminate the loop      
     Break transfers control to the statement immediately following the repeat.
    When used within nested Loop statements, Break transfers control to the loop that is nested one level above the loop where it occurs.
         
Sample   
<HTML>
<BODY>
<CARAVAN>
loop ctr (100)
"The value of the counter is "
ctr(counter)

if ctr(counter) = "50"
      break
repeat ctr 101
</CARAVAN>
</BODY>
</HTML>
Loop statements in Caravan can be nested to any number of levels .

End value of the loop statement can be replaced with a variable. But the end value of a repeat statement has to be a constant. Loops can be used to display array values and record sets directly.
  
Home       Back