Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In a cognos macro that I am writing

Status
Not open for further replies.
Sep 29, 2003
19
CA
In a cognos macro that I am writing, it needs to check if a certain event has occured and it the even has not occured, the macro has to wait for 10 minutes and check again.
Is there a statement in CognosScript that will make the macro wait for a certain time before executing the next statement?


The query has already been posted here and the answer was related to processor dependent loop.But I need a processor independent delay loop.Griffin , could you please help in this.You have answered that you have the loop.

I am expecting something like sleep function in C.Is this possible in Macro?


Regards
Coglearner
 
There is a sleep function available in VB that you can use with Script editor. Let me know if you can't find it and I'll post the syntax.

flex
 
If you can't find that one, try this:

FUNCTION Delay(secs%) '[2]
X = TIMER
DO WHILE TRUE
Y = TIMER
IF Y-X > secs% THEN
EXIT DO
END IF
LOOP
Delay = 0
End Function

It delays with a processor-independent looper using the system time.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
This is the command that I was talking about and let's you bypass any loops.

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

sub main()
'To call the Sleep function, you could use code like the 'following:
' sleep for 3 seconds
Call Sleep (3000)

end sub

flex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top