PureBytes Links
Trading Reference Links
|
Hi Peter,
the latter two forms in your posting should be IMHO not correct.
Otherwise negation of a variable, fe. -myvar) would
not function. Please see TJ's postings on that.
As Tomasz wrote, the increment and decrement operators
are alternative shorthand writings. Here is a summary:
x = --i means i = i - 1; x = i
x = ++i means i = i + 1; x = i
x = i-- means x = i; i = i - 1
x = i++ means x = i; i = i + 1
There is another short hand writing:
x += y means x = x + y
x -= y means x = x - y
It is not a must to use these shorthand writings; one
should use the variant which one likes most.
UM
----- Original Message -----
From: "amiabilityy" <amiabilityy@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, April 30, 2003 5:27 PM
Subject: [amibroker] Re: Motr loop questions
The ++ operator is used to express incrementing directly rather than
the more long winded and equally correct i += 1 or i = i + 1
There are two forms of the increrment
(and 2 corresponding forms of the decrement)
i++ post-increment.
++i pre- increment.
i- post-decrement.
-i pre-decrement.
These are expresions that return a value
The post increment form returns the value of i after it has been
incremented, while the pre increment form returns the value before i
was incremented.
Note: i am not sure if ami can use the decrement forms.
Peter.
--- In amibroker@xxxxxxxxxxxxxxx, "IVA GmbH" <funnybiz@xxxx> wrote:
> Hello,
>
> I´d appreciate if someone ould clarify the following "loop
questions":
>
> 1./ Where in the AFL code can those loops if/else and why/for be
embedded? Just anywhere, where they´re needed?
>
> 2./ Can we have nested loops?
>
> 3./ In case of severeal loops in my code, can I use any letter
instead of the "i" for the iteration part so that AFL doesn´t get
mixed up?
>
> 4./ What is the difference between "i++" and "++i". I saw it in one
of -I believe- TJ´s posts.
>
> Many thanks
>
> Markus
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/O10svD/Me7FAA/AG3JAA/GHeqlB/TM
---------------------------------------------------------------------~->
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 http://docs.yahoo.com/info/terms/
|