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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script won't close files and open new ones 1

Status
Not open for further replies.

Pedemonti

MIS
Aug 25, 2003
14
AR
Hi all! I have been in the scripting world for just a week so this will be a newbie question...

I have to make a script that runs 24hs a day and that at exactly 11:59PM the file in which it was capturing the output of the screen is closed and then it opens a new file with the new date. The thing is that the script I modified from aspectscripting.com is not working properly: it opens the first file but at 11:59PM nothing happens... The modified script is this:


;**** START ****
proc main

integer iDay, iMonth, iYear, iHour, iMin, iSec
string sFile

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

strfmt sFile "%02d%02d%02d" iYear iMonth iDay

set capture file sFile

capture on

while 1

if iHour == 11 && iMin == 59

capture off

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sFile "%02d%02d%02d" iYear iMonth iDay
set capture file sFile

capture on

endif

pause 60

endwhile

endproc

;**** END ****

Any ideas?

Thanks.
 
If you want the script to close and open capture files at 11:59 PM, then you want to check for iHour being equal to 23 instead of 11 (i.e. use military time). Other than that, everything looked OK at first glance to me.

 

Great, thanks... I'll check it.

I found another thing: when the script starts, I need to push the OK button so the script can start to capture the output. Is there any way to do that automatically?
 

I just checked the script again (it was not going to defeat me! he!) and I found that there was a line missing inside the WHILE statement and before the IF statement. The missing line is " ltimeints $LTIME iYear iMonth iDay iHour iMin iSec ".

I hope this might help anybody with the same problem I had.

Regards,
Pedemonti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top