[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] For loop



PureBytes Links

Trading Reference Links




Hello wavemechanic,
you can of course also use
 
for( i = 
0, j = 0<FONT 
face="Times New Roman">; i < BarCount; i = i + istep,  j = j + jstep 
)
<FONT 
face="Times New Roman"><FONT 
size=4>where istep and jstep can be any number 
or variable.
 
UM
<FONT 
size=3> 
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  wavemechanic 
  
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Wednesday, May 28, 2003 2:11 
  PM
  Subject: Re: [amibroker] For loop
  
  Tomasz:
   
  Thanks, but I was searching for a way to increment 
  one variable in defined steps other than 1, rather than two variables.  I 
  think Walt and Herman, or my old fashion way of using an accumulator, will 
  work.
   
  Bill
  <BLOCKQUOTE 
  >
    ----- Original Message ----- 
    <DIV 
    >From: 
    Tomasz Janeczko 
    
    To: <A title=amibroker@xxxxxxxxxxxxxxx 
    href="">amibroker@xxxxxxxxxxxxxxx 
    Sent: Wednesday, May 28, 2003 3:38 
    AM
    Subject: Re: [amibroker] For loop
    
    Bill,
     
    You can increment as many variables as you 
    want.
    Example (useless but simple :-))
    
    for( i = <FONT color=#ff00ff 
    size=1>0, j = <FONT color=#ff00ff 
    size=1>0; i < BarCount; i++, j++ ){
       r<FONT 
    size=1>esult[j]=C[i]+V[j];
    }
    You can also nest loops:
    for( j = 0; j < 10 ; j++ )  for( k = 0; k < 
    BarCount; k++ )  { 
            result[ k ] 
    = j+result[k];  }
    Best regards,Tomasz Janeczkoamibroker.com
    <BLOCKQUOTE 
    >
      ----- Original Message ----- 
      <DIV 
      >From: 
      <A title=wd78@xxxxxxxxxxxx 
      href="">wavemechanic 
      To: <A 
      title=amibroker@xxxxxxxxxxxxxxx 
      href="">AmiBroker 
      Sent: Wednesday, May 28, 2003 1:32 
      AM
      Subject: [amibroker] For loop
      
      Does the FOR loop statement, which is normally 
      shown as for (xxx; yyy; zzz), permit the addition of another statement for 
      incrementing the variable xxx?  And if so, what is the 
      syntax?
       
      TIA
       
      <FONT 
size=2>Bill






Yahoo! Groups Sponsor


  ADVERTISEMENT 









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.