For loop

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

For loop

Bhathiya Jayasekara
Hi,
Can someone give me the syntax for for loop in Jason? Or any other loop at least? 

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: For loop

sachini weerawardhana
Hi Bhathiya,

A loop to do what? Iterate through a list of items? Iteratively call a plan?
I am sending you the syntax to do both.


Iteratively execute a plan
===============
!keep_busy.

+!keep_busy <- .random(X); .print(X); .wait(10000); !!keep_busy. //this prints a random value every 10 seconds


iterate through a list of elements
=====================
!start.

+!start : true <-
        for ( .member(X,[a,b,c]) ){
            .print(X)
            }.

There are other loop constructs like foreach and loop in the api (http://jason.sourceforge.net/api/).
you can also use while( "logical condition") {<statements>}


HTH

Sachini

On Mon, Jan 24, 2011 at 3:39 PM, Bhathiya Jayasekara <[hidden email]> wrote:
Hi,
Can someone give me the syntax for for loop in Jason? Or any other loop at least? 

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: For loop

Bhathiya Jayasekara
Hi Sachini Madam,

Thank you for the response. It is to execute a plan iteratively, and your guide was helpful.

Regards,

On Wed, Jan 26, 2011 at 6:51 PM, sachini weerawardhana <[hidden email]> wrote:
Hi Bhathiya,

A loop to do what? Iterate through a list of items? Iteratively call a plan?
I am sending you the syntax to do both.


Iteratively execute a plan
===============
!keep_busy.

+!keep_busy <- .random(X); .print(X); .wait(10000); !!keep_busy. //this prints a random value every 10 seconds


iterate through a list of elements
=====================
!start.

+!start : true <-
        for ( .member(X,[a,b,c]) ){
            .print(X)
            }.

There are other loop constructs like foreach and loop in the api (http://jason.sourceforge.net/api/).
you can also use while( "logical condition") {<statements>}


HTH

Sachini

On Mon, Jan 24, 2011 at 3:39 PM, Bhathiya Jayasekara <[hidden email]> wrote:
Hi,
Can someone give me the syntax for for loop in Jason? Or any other loop at least? 

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users





--
-Bhathiya Jayasekara-
http://www.google.com/profiles/tobhathiyaj

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Jason-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jason-users
Loading...