How to delay my program for 5 sec in Netrexx

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

How to delay my program for 5 sec in Netrexx

Quique Britto
Hi guys,

is their a built in method to delay the execution of a program by a number of seconds, basically I need to run a method after a 5 second delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to work in Netrexx.

any help is much appreciated..


Java code
Thread.currentThread().sleep(5000);//sleep for 5000 ms
   
}
catch(ItrerruptedException ie)


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

ThSITC
Hello Quique,

I am including here a piece of Code I did originally get from Rene Vincent Jansen. PRESIDENT RexxLA, *years ago* to resolve some necessary DELAYS (and also garbage collection) between important STEP's of a program, to resolve some open issues I did have at this time.

 /*************************************************************************/
/* IBM Materials Licensed under International Components for Unicode     */
/* Licence version 1.8.1 (ICU Licence) - Property of IBM                 */
/* --------------------------------------------------------------------- */
/* The former Rexx2Nrx Run-Time Package (NetRexx Version)                */
/* of Thomas Schneider, ThSITC, 2011. See www.thsitc.com/Product Rexx2Nrx*/
/* for Details. Note that the method names have been adjusted for Java   */
/* naming conventions since the first Rexx2Nrx release, back in 2001!    */
/* --------------------------------------------------------------------- */
/* Copyright (c) 2000-2010 [hidden email]                   */
/* Copyright (c) 2011-oo   RexxLA                                        */
/*************************************************************************/

/* Memory: Memory routines as I got them from Rene Jansen */
package org.netrexx.runtime.compatibility
class Memory
method memoryUsage() static
    gc()
    totalMemory = Runtime.getRuntime().totalMemory()
    gc()
    freeMemory =  Runtime.getRuntime().freeMemory()
    return (totalMemory + 999999) % 1000000 "MB"

  /**
   * Does two garbage collects and runs finalizations
   */
  method gc() static
    do
      System.gc()
      Thread.currentThread.sleep(100)
      System.runFinalization()
      Thread.currentThread.sleep(100)
      System.gc()
      Thread.currentThread.sleep(100)
      System.runFinalization()
      Thread.currentThread.sleep(100)
    catch e=Exception
      e.printStackTrace()
    end
/****************************************************/   
/* the System.gc does the actual garbage collection */
/****************************************************/

==================================================
Thus, I *think*, that you should use Thread.currentThread.sleep(500) for a delay of 5 seconds....

Thomas.

PS: As my runtime.compatibility packae is not yet in the current NetRexxC 3.01RC1 distribution, the easiest way for you would to extract the inline code
above, and adapt it to your needs ... :-)

Hope this helps ... :-)
Greetings from Vienna, Thomas.
========================================================
Am 08.09.2011 12:26, schrieb Quique Britto:
Hi guys,

is their a built in method to delay the execution of a program by a number of seconds, basically I need to run a method after a 5 second delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to work in Netrexx.

any help is much appreciated..


Java code
Thread.currentThread().sleep(5000);//sleep for 5000 ms
   
}
catch(ItrerruptedException ie)



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



--
Thomas Schneider (www.thsitc.com)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com
Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

rvjansen
In reply to this post by Quique Britto
Hi Quique,

something like

say 'take 5'
Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.

On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:

> Hi guys,
>
> is their a built in method to delay the execution of a program by a
> number of seconds, basically I need to run a method after a 5 second
> delay.
> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
> work in Netrexx.
>
> any help is much appreciated..
>
> Java code
>
> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>
> }
> catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

rvjansen
In reply to this post by ThSITC
Thomas,

please - there are so many things wrong with this, I don't know where
to start.
Actually, you never should do explicit garbage collects, and neither
should you depend on gc to cause delays - there are kinds of parallel gc
algorithms nowadays.

This was, far away and long ago, some quick way to assess a memory
problem. It should go to where it belongs.

best regards,

René.

On Thu, 08 Sep 2011 13:39:47 +0200, Thomas Schneider wrote:

> Hello Quique,
>
>  I am including here a piece of Code I did originally get from Rene
> Vincent Jansen. PRESIDENT RexxLA, *years ago* to resolve some
> necessary DELAYS (and also garbage collection) between important
> STEP's of a program, to resolve some open issues I did have at this
> time.
>
>
>
> /*************************************************************************/
>  /* IBM Materials Licensed under International Components for Unicode
> */
>  /* Licence version 1.8.1 (ICU Licence) - Property of IBM */
>  /*
> ---------------------------------------------------------------------
> */
>  /* The former Rexx2Nrx Run-Time Package (NetRexx Version) */
>  /* of Thomas Schneider, ThSITC, 2011. See www.thsitc.com/Product [3]
> Rexx2Nrx*/
>  /* for Details. Note that the method names have been adjusted for
> Java */
>  /* naming conventions since the first Rexx2Nrx release, back in
> 2001! */
>  /*
> ---------------------------------------------------------------------
> */
>  /* Copyright (c) 2000-2010 [hidden email] [4] */
>  /* Copyright (c) 2011-oo RexxLA */
>
>
> /*************************************************************************/
>
>  /* Memory: Memory routines as I got them from Rene Jansen */
>  package org.netrexx.runtime.compatibility
>  class Memory
>  method memoryUsage() static
>  gc()
>  totalMemory = Runtime.getRuntime().totalMemory()
>  gc()
>  freeMemory = Runtime.getRuntime().freeMemory()
>  return (totalMemory + 999999) % 1000000 "MB"
>
>  /**
>  * Does two garbage collects and runs finalizations
>  */
>  method gc() static
>  do
>  System.gc()
>  Thread.currentThread.sleep(100)
>  System.runFinalization()
>  Thread.currentThread.sleep(100)
>  System.gc()
>  Thread.currentThread.sleep(100)
>  System.runFinalization()
>  Thread.currentThread.sleep(100)
>  catch e=Exception
>  e.printStackTrace()
>  end
>  /****************************************************/
>  /* the System.gc does the actual garbage collection */
>  /****************************************************/
>
>  ==================================================
>  Thus, I *think*, that you should use Thread.currentThread.sleep(500)
> for a delay of 5 seconds....
>
>  Thomas.
>
>  PS: As my runtime.compatibility packae is not yet in the current
> NetRexxC 3.01RC1 distribution, the easiest way for you would to
> extract the inline code
>  above, and adapt it to your needs ... :-)
>
>  Hope this helps ... :-)
>  Greetings from Vienna, Thomas.
>  ========================================================
>  Am 08.09.2011 12:26, schrieb Quique Britto:
>
>> Hi guys,
>>
>> is their a built in method to delay the execution of a program by
>> a number of seconds, basically I need to run a method after a 5
>> second delay.
>> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it
>> to work in Netrexx.
>>
>> any help is much appreciated..
>>
>> Java code
>>
>> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>>
>> }
>> catch(ItrerruptedException ie)
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email] [1]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [2]

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Aviatrexx
In reply to this post by Quique Britto
Is it possible that the problem is not in the "sleep" but in your
"catch"?  If that is a cut-n-paste from your code, there is a typo
(which I would have expected to generate a compile-time error).

-Chip-

On 9/8/11 10:26 Quique Britto said:

> Hi guys,
>
> is their a built in method to delay the execution of a program by a
> number of seconds, basically I need to run a method after a 5 second delay.
> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
> work in Netrexx.
>
> any help is much appreciated..
>
>
> Java code
>
> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>    
> }
> catch(ItrerruptedException ie)
>
>
>
> ------------------------------------------------------------------------

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Quique Britto
In reply to this post by rvjansen
I have tried the flwg but receive the error shown below.

<snip>
-- delay 5 seconds
   do
        say 'take 5'
        Thread.currentThread().sleep( 5000 )
        say 'took5'
           
        catch e=Exception
           say e        
   end
<snip>

receive the error.:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA80AAAAQCAIAAACjnArOAAAFJUlEQVR4nO1dW3atOgzrnJj/2Dg/d+1LsS3LToDQLX10sUOQFdkxaXseP7sgCIIgCIIgCLPx87QAQRAEQRAEQfiD0DlbmIlt27ZtezD0U9F5LKXwFY69C1U/31K3wv1IC+OGynlLfa6vUPgGuHX4c7x9wo3ayvgovFPn4p6kuEf/Iy6Vgj6bxyj6g9+f3BzuqT6THlluiHJR0BuwjtTGdzIXKRkBqSqddunqXlTMq/VVHqspvPonBZf24RveLw39P9GM1XJ/xEfbUu/p9aFzdmPydKxWRffrearPLFj/qxXDK/A3ztkkdM5+RfQRrKa8oWfiOXscV79fpp2zT0I/Pzk+uhmNH0cYntPdkUUycdNxzOPeSvXsnqWMHtdz+5HxuaS/Eff4rKWy1ykPUBWRMFTR/ONHe23FN/R/ngJ6MD/5cURPxMP44N4FEV1+S3Li7+ncDFz+ER/sorAJqR4Ql4ni8tjQ/HjEb+XtQUK3OPWkz8C31ARARZLgj0B/yc/TZPDI7tUbv65U/7jPx4/2ejf5bej/PAX0YH7yY9tP+7j1hA8xRf9JQORbacmRzv33xo/4o4gl/adY9/vjOnY+Z7sPR3YzYVzpJFU0kxmP4qbjmIdRyAsY0dPwua2fjMuM8DykHvJxZnKU62qdtAGKbaQe+KD4Y+oDuYtBn3E5sQB+GtY26EMPs/pnyjxeP7ywqE623++t49eUls+jBdMM2/2nnS+y3qy3PZ5BGQyiyaXtPCKAETZ9X4BYgAffGue/rk8CSUyiU/7xPrwdkPLc4M/O/Dwb8Fb71/Q9Y2+lFqfXs/STprW1bQbV0CmAJ27cKEq0FsyDackSZaiwzui6qr8hLM1vKS9kUCYu1sBHjEIzhMB/5hqoSj/ynCnS7TMSC/jjFgkunkF/oovpeUyVM8vBPMC3dr1FPKlOLCZdF5/WFNHkUk6r+hvC0nyR80E4kEdwQa6lpJ+ZD65JSSUSzM8XJFNLjM6r/dnBn89uj5O+tEGKqfqV5gaEvk3nYB1fsX8sJx7pNZc07pTUfG4xOZpSzEBYVUPbkMG+1oiL/ScJyfrn9+94f28g3T6z+s94b59VJ6eL6XnEPNFgqW6r+5RRxZwJXM6RTsjLaFDZW9/QV3Ee7VeGkxQwck4Y3F8fVOOmdxt9OO1pN/uzk38PstSje33Hvl8BmL1RzQfT10peN/om3t78hmfyRbqN47pZAyPH+Yu8D1ye1d4HbhZKeQH7i+ep7rsobpXTfXawP6Z1O6sPYJRkjBR52n/SDTWrTk4X0/NI8vQaSGnfYU6SJ+Uc6YTp4+qrs+YfHTi5gX0rZaQ0v7G/Un5mf13dh2f5Oav/7My/6+cOgvHTLWb+7q0fA8c9EtpBfB3pB3FTkSV/3ChYTCR+UH8ad/d8Bqs7EWKpkRjST5LKvdWIy4fGqiKRkZ/t+SBfLo8djObbKDiunemKT6nS+VY56YM732UrgVlXuliGf/fySPIz/uy/369RLKsEhHZ53KVVrXCXVuIB5NHa3aDMklMHAA+5tGhy2x93PvANxOVDY1WRSNfVSOfg/NOD0SN2POKPrGPmW5F2XakewLnD+gERgdQotHvthsZiorXg6Az0/9QIwi+4+/Cp0K/DCktYQcO3QZ4LGOqrwtdC52xB+B9uR9b7gMcKS1hBw7dBngsA6qvCN0PnbEH4D+A3Tdd16ug3XC/CUktYR8mfx1J5F5aF+qrw5dA5WxAEQRAEQRDmQ+dsQRAEQRAEQZiPfx2zsR2wICbRAAAAAElFTkSuQmCC" alt="">



On 8 September 2011 15:44, rvjansen <[hidden email]> wrote:
Hi Quique,

something like

say 'take 5'

Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.


On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
Hi guys,

is their a built in method to delay the execution of a program by a
number of seconds, basically I need to run a method after a 5 second
delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
work in Netrexx.

any help is much appreciated..

Java code

Thread.currentThread().sleep(5000);//sleep for 5000 ms

}
catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

ThSITC
In reply to this post by rvjansen
Then, Rene, I would propose that somebody more knowledgable than I
am, is responding to Qitto's demand.

But I would like to tell your that I'm using this ancient Code of
you/your team
still now without any problems.... :-)

I'm surely NO Java Expert.

I'm, however, thinking, that I do know Rexx, ooRexx, and NetRexx quite
well, ;-)

... and I would like to thank you, personally, that you did help me out
with your advise years ago ...

Thomas.
==========================================================
Am 08.09.2011 15:48, schrieb rvjansen:

> Thomas,
>
> please - there are so many things wrong with this, I don't know where
> to start.
> Actually, you never should do explicit garbage collects, and neither
> should you depend on gc to cause delays - there are kinds of parallel
> gc algorithms nowadays.
>
> This was, far away and long ago, some quick way to assess a memory
> problem. It should go to where it belongs.
>
> best regards,
>
> René.
>
> On Thu, 08 Sep 2011 13:39:47 +0200, Thomas Schneider wrote:
>> Hello Quique,
>>
>>  I am including here a piece of Code I did originally get from Rene
>> Vincent Jansen. PRESIDENT RexxLA, *years ago* to resolve some
>> necessary DELAYS (and also garbage collection) between important
>> STEP's of a program, to resolve some open issues I did have at this
>> time.
>>
>>
>>
>> /*************************************************************************/
>>
>>  /* IBM Materials Licensed under International Components for Unicode
>> */
>>  /* Licence version 1.8.1 (ICU Licence) - Property of IBM */
>>  /*
>> ---------------------------------------------------------------------
>> */
>>  /* The former Rexx2Nrx Run-Time Package (NetRexx Version) */
>>  /* of Thomas Schneider, ThSITC, 2011. See www.thsitc.com/Product [3]
>> Rexx2Nrx*/
>>  /* for Details. Note that the method names have been adjusted for
>> Java */
>>  /* naming conventions since the first Rexx2Nrx release, back in
>> 2001! */
>>  /*
>> ---------------------------------------------------------------------
>> */
>>  /* Copyright (c) 2000-2010 [hidden email] [4] */
>>  /* Copyright (c) 2011-oo RexxLA */
>>
>>
>> /*************************************************************************/
>>
>>
>>  /* Memory: Memory routines as I got them from Rene Jansen */
>>  package org.netrexx.runtime.compatibility
>>  class Memory
>>  method memoryUsage() static
>>  gc()
>>  totalMemory = Runtime.getRuntime().totalMemory()
>>  gc()
>>  freeMemory = Runtime.getRuntime().freeMemory()
>>  return (totalMemory + 999999) % 1000000 "MB"
>>
>>  /**
>>  * Does two garbage collects and runs finalizations
>>  */
>>  method gc() static
>>  do
>>  System.gc()
>>  Thread.currentThread.sleep(100)
>>  System.runFinalization()
>>  Thread.currentThread.sleep(100)
>>  System.gc()
>>  Thread.currentThread.sleep(100)
>>  System.runFinalization()
>>  Thread.currentThread.sleep(100)
>>  catch e=Exception
>>  e.printStackTrace()
>>  end
>>  /****************************************************/
>>  /* the System.gc does the actual garbage collection */
>>  /****************************************************/
>>
>>  ==================================================
>>  Thus, I *think*, that you should use Thread.currentThread.sleep(500)
>> for a delay of 5 seconds....
>>
>>  Thomas.
>>
>>  PS: As my runtime.compatibility packae is not yet in the current
>> NetRexxC 3.01RC1 distribution, the easiest way for you would to
>> extract the inline code
>>  above, and adapt it to your needs ... :-)
>>
>>  Hope this helps ... :-)
>>  Greetings from Vienna, Thomas.
>>  ========================================================
>>  Am 08.09.2011 12:26, schrieb Quique Britto:
>>
>>> Hi guys,
>>>
>>> is their a built in method to delay the execution of a program by
>>> a number of seconds, basically I need to run a method after a 5
>>> second delay.
>>> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it
>>> to work in Netrexx.
>>>
>>> any help is much appreciated..
>>>
>>> Java code
>>>
>>> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>>>
>>> }
>>> catch(ItrerruptedException ie)
>>>
>>> _______________________________________________
>>> Ibm-netrexx mailing list
>>> [hidden email] [1]
>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [2]
>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
>
>


--
Thomas Schneider (www.thsitc.com)
_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Thomas Schneider, Vienna, Austria (Europe) :-)

www.thsitc.com
www.db-123.com
Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Quique Britto
In reply to this post by Quique Britto
sorry error received is:
Error: cannot convert value of type 'java.lang.exception' for assignment to variable of type 'java.awt.event.ActionEvent'



On 8 September 2011 16:13, Quique Britto <[hidden email]> wrote:
I have tried the flwg but receive the error shown below.

<snip>
-- delay 5 seconds
   do

        say 'take 5'
        Thread.currentThread().sleep( 5000 )
        say 'took5'
           
        catch e=Exception
           say e        
   end
<snip>

receive the error.:





On 8 September 2011 15:44, rvjansen <[hidden email]> wrote:
Hi Quique,

something like

say 'take 5'

Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.


On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
Hi guys,

is their a built in method to delay the execution of a program by a
number of seconds, basically I need to run a method after a 5 second
delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
work in Netrexx.

any help is much appreciated..

Java code

Thread.currentThread().sleep(5000);//sleep for 5000 ms

}
catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

measel
Say e.message
 
From: Quique Britto [mailto:[hidden email]]
Sent: Thursday, September 08, 2011 10:17 AM
To: IBM Netrexx <[hidden email]>
Subject: Re: [Ibm-netrexx] How to delay my program for 5 sec in Netrexx
 
sorry error received is:
Error: cannot convert value of type 'java.lang.exception' for assignment to variable of type 'java.awt.event.ActionEvent'



On 8 September 2011 16:13, Quique Britto <[hidden email]> wrote:
I have tried the flwg but receive the error shown below.

<snip>
-- delay 5 seconds
   do

        say 'take 5'
        Thread.currentThread().sleep( 5000 )
        say 'took5'
           
        catch e=Exception
           say e        
   end
<snip>

receive the error.:





On 8 September 2011 15:44, rvjansen <[hidden email]> wrote:
Hi Quique,

something like

say 'take 5'

Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.


On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
Hi guys,

is their a built in method to delay the execution of a program by a
number of seconds, basically I need to run a method after a 5 second
delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
work in Netrexx.

any help is much appreciated..

Java code

Thread.currentThread().sleep(5000);//sleep for 5000 ms

}
catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

rvjansen
In reply to this post by Quique Britto
is the variable 'e' previously used for another exception type in your
source?

René.


On Thu, 8 Sep 2011 16:13:56 +0200, Quique Britto wrote:

> I have tried the flwg but receive the error shown below.
>
> -- delay 5 seconds
>    do
>         say 'take 5'
>         Thread.currentThread().sleep( 5000 )
>         say 'took5'
>             
>         catch e=Exception
>            say e        
>    end
>
> receive the error.:
>
> On 8 September 2011 15:44, rvjansen  wrote:
>
>> Hi Quique,
>>
>> something like
>>
>> say 'take 5'
>>
>> Thread.currentThread().sleep(5000) --sleep for 5000 ms
>> say 'took5'
>>
>> should work.
>>
>> best regards,
>>
>> René.
>>
>> On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
>>
>>> Hi guys,
>>>
>>> is their a built in method to delay the execution of a program
>>> by a
>>> number of seconds, basically I need to run a method after a 5
>>> second
>>> delay.
>>> I have tried using the Java Thread.Sleep( 5000 ) but cannot get
>>> it to
>>> work in Netrexx.
>>>
>>> any help is much appreciated..
>>>
>>> Java code
>>>
>>> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>>>
>>> }
>>> catch(ItrerruptedException ie)
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email] [1]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [2]
>
>
>
> Links:
> ------
> [1] mailto:[hidden email]
> [2] http://ibm-netrexx.215625.n3.nabble.com/
> [3] mailto:[hidden email]

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Robert L Hamilton
In reply to this post by rvjansen
Seem to work in jEDit/NetRexxDE.

BobH

On Thu, Sep 8, 2011 at 8:44 AM, rvjansen <[hidden email]> wrote:
Hi Quique,

something like

say 'take 5'

Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.


On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
Hi guys,

is their a built in method to delay the execution of a program by a
number of seconds, basically I need to run a method after a 5 second
delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to
work in Netrexx.

any help is much appreciated..

Java code

Thread.currentThread().sleep(5000);//sleep for 5000 ms

}
catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

KP Kirchdörfer
In reply to this post by Quique Britto

Am Donnerstag, 8. September 2011, 16:13:56 schrieben Sie:

> I have tried the flwg but receive the error shown below.

>

> <snip>

> -- delay 5 seconds

> do

> say 'take 5'

> Thread.currentThread().sleep( 5000 )

> say 'took5'

>

> catch e=Exception

> say e

> end

> <snip>

>

> receive the error.:

>

 

Quique;

 

it's a snippet :) and I guess you have declared "e" as ActionEvent somewhere before.

 

Just took the snippet, added it into eclipse/w NetRexx plugin and got

 

NetRexx portable processor, version 2.02

Copyright (c) IBM Corporation, 2001. All rights reserved.

Program sleep1.nrx

===== Exec: sleep1 =====

take 5

took5

Processing of 'sleep1.nrx' complete

 

 

kp

 

 

> On 8 September 2011 15:44, rvjansen <[hidden email]> wrote:

> > Hi Quique,

> >

> > something like

> >

> > say 'take 5'

> >

> > Thread.currentThread().sleep(**5000) --sleep for 5000 ms

> > say 'took5'

> >

> > should work.

> >

> > best regards,

> >

> > René.

> >

> > On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:

> >> Hi guys,

> >>

> >> is their a built in method to delay the execution of a program by a

> >> number of seconds, basically I need to run a method after a 5 second

> >> delay.

> >> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to

> >> work in Netrexx.

> >>

> >> any help is much appreciated..

> >>

> >> Java code

> >>

> >> Thread.currentThread().sleep(**5000);//sleep for 5000 ms

> >>

> >> }

> >> catch(ItrerruptedException ie)

> >

> > ______________________________**_________________

> > Ibm-netrexx mailing list

> > [hidden email]

> > Online Archive :

> > http://ibm-netrexx.215625.n3.**nabble.com/<http://ibm-netrexx.215625.n3.

> > nabble.com/>

 

 


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Quique Britto
In reply to this post by rvjansen
yes, is this the problem?

On 8 September 2011 16:25, rvjansen <[hidden email]> wrote:
is the variable 'e' previously used for another exception type in your source?

René.



On Thu, 8 Sep 2011 16:13:56 +0200, Quique Britto wrote:
I have tried the flwg but receive the error shown below.

-- delay 5 seconds
   do
        say 'take 5'
        Thread.currentThread().sleep( 5000 )
        say 'took5'
            
        catch e=Exception
           say e        
   end

receive the error.:

On 8 September 2011 15:44, rvjansen  wrote:

Hi Quique,

something like

say 'take 5'

Thread.currentThread().sleep(5000) --sleep for 5000 ms
say 'took5'

should work.

best regards,

René.

On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:

Hi guys,

is their a built in method to delay the execution of a program
by a
number of seconds, basically I need to run a method after a 5
second
delay.
I have tried using the Java Thread.Sleep( 5000 ) but cannot get
it to
work in Netrexx.

any help is much appreciated..

Java code

Thread.currentThread().sleep(5000);//sleep for 5000 ms

}
catch(ItrerruptedException ie)

_______________________________________________
Ibm-netrexx mailing list
[hidden email] [1]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [2]



Links:
------
[1] mailto:[hidden email]
[2] http://ibm-netrexx.215625.n3.nabble.com/
[3] mailto:[hidden email]

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/



_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

Quique Britto
In reply to this post by KP Kirchdörfer
correct, now working.

thks to all



On 8 September 2011 16:33, KP Kirchdoerfer <[hidden email]> wrote:

Am Donnerstag, 8. September 2011, 16:13:56 schrieben Sie:

> I have tried the flwg but receive the error shown below.

>

> <snip>

> -- delay 5 seconds

> do

> say 'take 5'

> Thread.currentThread().sleep( 5000 )

> say 'took5'

>

> catch e=Exception

> say e

> end

> <snip>

>

> receive the error.:

>

 

Quique;

 

it's a snippet :) and I guess you have declared "e" as ActionEvent somewhere before.

 

Just took the snippet, added it into eclipse/w NetRexx plugin and got

 

NetRexx portable processor, version 2.02

Copyright (c) IBM Corporation, 2001. All rights reserved.

Program sleep1.nrx

===== Exec: sleep1 =====

take 5

took5

Processing of 'sleep1.nrx' complete

 

 

kp

 

 

> On 8 September 2011 15:44, rvjansen <[hidden email]> wrote:

> > Hi Quique,

> >

> > something like

> >

> > say 'take 5'

> >

> > Thread.currentThread().sleep(**5000) --sleep for 5000 ms

> > say 'took5'

> >

> > should work.

> >

> > best regards,

> >

> > René.

> >

> > On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:

> >> Hi guys,

> >>

> >> is their a built in method to delay the execution of a program by a

> >> number of seconds, basically I need to run a method after a 5 second

> >> delay.

> >> I have tried using the Java Thread.Sleep( 5000 ) but cannot get it to

> >> work in Netrexx.

> >>

> >> any help is much appreciated..

> >>

> >> Java code

> >>

> >> Thread.currentThread().sleep(**5000);//sleep for 5000 ms

> >>

> >> }

> >> catch(ItrerruptedException ie)

> >

> > ______________________________**_________________

> > Ibm-netrexx mailing list

> > [hidden email]

> > Online Archive :

> > http://ibm-netrexx.215625.n3.**nabble.com/<http://ibm-netrexx.215625.n3.

> > nabble.com/>

 

 


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/




_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: How to delay my program for 5 sec in Netrexx

rvjansen
In reply to this post by Quique Britto
most probably - you cannot assign another type to a variable which is
already used for one type - for exception types I usually use some
abbreviation of the type - or add a number.

René.

On Thu, 8 Sep 2011 16:38:06 +0200, Quique Britto wrote:

> yes, is this the problem?
>
> On 8 September 2011 16:25, rvjansen  wrote:
>
>> is the variable 'e' previously used for another exception type in
>> your source?
>>
>> René.
>>
>> On Thu, 8 Sep 2011 16:13:56 +0200, Quique Britto wrote:
>>
>>> I have tried the flwg but receive the error shown below.
>>>
>>> -- delay 5 seconds
>>>    do
>>>         say 'take 5'
>>>         Thread.currentThread().sleep( 5000 )
>>>         say 'took5'
>>>             
>>>         catch e=Exception
>>>            say e        
>>>    end
>>>
>>> receive the error.:
>>>
>>> On 8 September 2011 15:44, rvjansen  wrote:
>>>
>>>> Hi Quique,
>>>>
>>>> something like
>>>>
>>>> say 'take 5'
>>>>
>>>> Thread.currentThread().sleep(5000) --sleep for 5000 ms
>>>> say 'took5'
>>>>
>>>> should work.
>>>>
>>>> best regards,
>>>>
>>>> René.
>>>>
>>>> On Thu, 8 Sep 2011 12:26:24 +0200, Quique Britto wrote:
>>>>
>>>>> Hi guys,
>>>>>
>>>>> is their a built in method to delay the execution of a
>>>>> program
>>>>> by a
>>>>> number of seconds, basically I need to run a method after a
>>>>> 5
>>>>> second
>>>>> delay.
>>>>> I have tried using the Java Thread.Sleep( 5000 ) but cannot
>>>>> get
>>>>> it to
>>>>> work in Netrexx.
>>>>>
>>>>> any help is much appreciated..
>>>>>
>>>>> Java code
>>>>>
>>>>> Thread.currentThread().sleep(5000);//sleep for 5000 ms
>>>>>
>>>>> }
>>>>> catch(ItrerruptedException ie)
>>>>
>>>> _______________________________________________
>>>> Ibm-netrexx mailing list
>>>> [hidden email] [1] [1]
>>>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [2]
>>>> [2]
>>>
>>> Links:
>>> ------
>>> [1] mailto:[hidden email] [3]
>>> [2] http://ibm-netrexx.215625.n3.nabble.com/ [4]
>>> [3] mailto:[hidden email] [5]
>>
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email] [6]
>> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ [7]
>
>
>
> Links:
> ------
> [1] mailto:[hidden email]
> [2] http://ibm-netrexx.215625.n3.nabble.com/
> [3] mailto:[hidden email]
> [4] http://ibm-netrexx.215625.n3.nabble.com/
> [5] mailto:[hidden email]
> [6] mailto:[hidden email]
> [7] http://ibm-netrexx.215625.n3.nabble.com/
> [8] mailto:[hidden email]

_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/