By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 38 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Hi Sathish,
I am not sure, How you are handling Count down.
I havent tried the similar concept. But, it may help you.
You can have the "THETIME" field, which store the count down time in seperate record format and overlay it on AUTOREF Record format. Try using UPDATE AUTOREF command every second when the time changes in THETIME field.
In the same loop, You can have condition for checking "THETIME = 0".
When ever THETIME = 0, you can perform the Required operation.
Let me know, If you have any clarification in above concept.
Pradeep.

Is your program running -- but not counting?
"how to split 30 seconds from time field using RPGLE program"
Not sure what that means, I guess you want to work on counting down from 30 seconds to 0. Here is an outline.
As your program starts you will need to compute ENDTIME = TIME + 30 secodns
inside of loop subtract TIME from ENDTIME giving RemainingTime in seconds
Display RemainingTime
Stop When RemainingTime <= zero
Have fun. "Time and Tide wait for no man"
"For thogh we slepe or wake, or rome, or ryde, Ay fleeth the tyme; it nil no [will no] man abyde." [c 1390 Chaucer Clerk's Tale]
Phil

Mr. Phil, i tried your tips.. but it not working...
becoz it's getting server time and add 30 seconds with it...
i want to count down 30 seconds in reverse order.. when it ll reach 0 seconds, go to next
screen using rpgle program....

ya Mr Phil.. just i show you, my concept...
D endtime s t - declare time field
D rtime s t -
eval endtime =%time + %seconds(30)
eval rtime = endtime-%time
my program two got error,
1) The types of the right and left hand side do not match in the
EVAL operation.
2) Operands are not compatible with the type of operator.
please suggestion me.....

With the 'WAITRCD(1)' and a quiet machine that will come close, it will count down and will never be less than 30 seconds.
Now you're ready to tackle user input on your counting screen...
Good Luck
Phil

Remove these two statements.
C remtime subdur 1:*seconds remtime
C move remtime time1
Make time1 a signed field on the display
C Eval time1 = endtime - %time
I would also change the Dow to
Dow *in03 = *off and time1 > 0
Then you are going to want to bring the status into the loop control, so you can tell when the user has entered a value.

Mr. Phil, i tried your tips,
Make time1 a signed field on the display
C Eval time1 = endtime - %time
i done like this.. but i got error,
*RNF7421 30 1 Operands are not compatible with the type of operator.
on this line - C Eval time1 = endtime - %time
please give me some suggestion...

Are you
Sure you stopped the job?
Sure you compiled the display and then the program?
This seems like it's from your old code with the move and a character field
0006491R might be -6,491 seconds or perhaps -6.491 seconds
Phil

Well, that's not going to display 0006491R
You compiled the display file and then compiled the program?
And the compiles were sucessful and there isn't two copies of either of these in other libraries.?
Phil

C eval endtime=endtime1+%seconds(30)
wrong should be
C eval endtime=%time+%seconds(30)
That error would create a big negative number
But that doesn't explain the format of the output, recompile the display and then the program.
Phil

Check it aganst the clock - isn't it counting the seconds?
Total process should be 30 seconds.
Isn't that what you want?
The design cannot display every second. But if your code looks like mine it's effectivey count seconds.
Of course you could go back to an earlier design which subracted 1 every loop giving a nice count down .. by ran for something over 30 seconds.
Phil

i got the output like this 29, 28, 26...
Does it take thirty seconds before it reaches zero? What happens when an answer is typed before it reaches zero? Does it stop counting? Does the program save the answer that was typed?
Tom

There are pieces that aren't totally necessary, like the CLOSE of the display file. That just adds some consistency for the DSPLY op-code which could be some other method. I didn't really need to set USERID to some initial value; I just wanted an easy way to tell if nothing had been entered at all. And I only have it going basically for ten seconds instead of 30 -- that just makes testing it out go a little faster.
But the way the two programs work is a little different. The differences should tell you things that aren't always obvious.
Tom

I need count down program which counts from 30 to 0. The above program I pasted, which counts 30 but I need to press enter key 30 times to count down the time to 0 after 0 is reached when I hit enter it count down from 12350 it doesn't automatically refresh. I need to press enter every time. Please send me some autorefresh program

COULD YOU PLEASE GIVE ME SOME WORKING PROGRAM FOR AUTO REFRESH PAGE. THE ABOVE PROGRAM DATED ON December 27, 2011 6:34 AM GMT LOOKS LIKE EASIER. PLEASE REPLACE THAT WITH FINE WORKING CODES.LET ME KNOW ONCE U REPLACED THAT.

THE PROGRAM IS WORKING BUT IT DOESN'T DO AUTO REFRESH. i NEED TO PRESS ENTER EVERY TIME TO DISPLAY THE TIME FROM 30 TO 00. THE TIME IS RUNNING IN BACKGROUND. FOR EXAMPLE YOUR TIME IS NOW IN 30 SECONDS. iF YOU PRESS ENTER IT WOULD BE 29 IF YOU DELAYED 4 SECONDS TO PRESS ENTER THEN THE TIME1 IS 25. I NEED TO GET THE TIME1 AUTOREFRESHED EVERYTIME WITHOUT PRESSING ENTER. pLEASE HELP ME

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

Share this item with your network:

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy