UniVerse supports the NAP [milliseconds] command.

On UniData it would be more efficient to use the PAUSE [time] / WAKE command 
which gives you both an automated timeout as well as allowing you to continue 
as soon as the PHANTOM declares it okay.

You can switch between both of these in your code if you have an 
pre-compilation process or with creative uses of subroutines.

Cheers,

Dan McGrath
Product Manager
Rocket Software
4600 South Ulster Street  ·  Suite 1100  ·   Denver, CO 80237 ·  USA
T: +1 720 475 8098 · E: dmcgr...@rocketsoftware.com · W: u2.rocketsoftware.com


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Farmer
Sent: Thursday, December 27, 2012 2:56 PM
To: 'U2 Users List'
Subject: [U2] Sleeping in Basic

Happy holidays all,

I just want to make sure I did not miss something over the U2 releases. Since 
the Microdata Reality days, I have used "SLEEP nn" to sleep for nn seconds. 
Simple, usually does the trick.

But in today's gotta have it now, I won't wait, environment, a second is 
sometimes way too long.

Is there anything I missed over the last few years to sleep for less than a 
second? I am executing a phantom command from a UniObjects subroutine call and 
waiting for it to finish. I am using a phantom, just in case the program aborts 
or hangs. I am not in control of what code is being run, it could try to read 
or write to an unopened file for example. If the program does hang, I get the 
dreaded "Error 30102" message (not helpful at all).

In most cases, the program reads the data it needs and finishes in less than a 
second.  The UniObjects subroutine then writes a flag I can pick up to see that 
the data is ready to return to the UniObjects client.

I don't want the subroutine constantly looping and reading for the flag. This 
would take a lot of the CPU cycles. But, I don't want to wait up to a second to 
see that the phantom has completed.

Any ideas would be helpful. This needs to run on both UniData and UniVerse.

Have a great New Year. One more year older for us "experienced" developers in 
the PICK community. (circa 1978)

Doug Farmer


This message has been scanned for malware by Websense. www.websense.com 
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to