Hello there, first time as a member here, just like to say thanks is greatly appreciated
I have been looking at some of the date changing info on this site and have not been able to implement it into my script that is suppose to get data every week by dialing up to the modem, but I am having difficulties changing the start date to a week before the date at which the gauge info is downloaded, to get the full week of data. My basic is:
proc main
string Name = "scotch.doc" ; Name of capture file to open.
set capture file Name ; Set name of capture file.
waitfor "NORMAL^[[20;25H"
transmit "u"
;area where i think i need to have a change in the start date
waitfor " ^H"
transmit "s"
waitfor "<<< Press ENTER to Start, A for Ascii, X/Ymodem, or ESC to Abort >>>^@^@^@"
transmit "a"
capture on ; Open up the capture file.
while $CARRIER ; Loop while connected to remote.
yield ; Yield processing time
waitfor "<<< Press ENTER to Continue >>>"
transmit "^M"
capture off ; Close the capture file.
endwhile
endproc
the function below is the one that i am trying to include in my script above, need to change the date after i tell procomm to transmit "u" for upload. but have been unable to do this, does anyone know an easy way?
can i get rid of iDaysAgo and just put a 7 in there??
func XDaysAgo : string
param integer iDaysAgo
integer iDay, iMonth, iYear, iHour, iMin, iSec
long lDate
string sDate
lDate = $LTIME - (86400 * iDaysAgo)
;Derive timeval for specified num. of days ago
ltimeints lDate iYear iMonth iDay iHour iMin iSec ;Convert timeval to integer components
strfmt sDate "%02d%02d%d" iMonth iDay iYear ;Create MMDDYYYY string
strdelete sDate 4 2 ;Delete first two numbers from year value
return sDate
sorry for the mess let me know if you have any ideas!
thanks again
I have been looking at some of the date changing info on this site and have not been able to implement it into my script that is suppose to get data every week by dialing up to the modem, but I am having difficulties changing the start date to a week before the date at which the gauge info is downloaded, to get the full week of data. My basic is:
proc main
string Name = "scotch.doc" ; Name of capture file to open.
set capture file Name ; Set name of capture file.
waitfor "NORMAL^[[20;25H"
transmit "u"
;area where i think i need to have a change in the start date
waitfor " ^H"
transmit "s"
waitfor "<<< Press ENTER to Start, A for Ascii, X/Ymodem, or ESC to Abort >>>^@^@^@"
transmit "a"
capture on ; Open up the capture file.
while $CARRIER ; Loop while connected to remote.
yield ; Yield processing time
waitfor "<<< Press ENTER to Continue >>>"
transmit "^M"
capture off ; Close the capture file.
endwhile
endproc
the function below is the one that i am trying to include in my script above, need to change the date after i tell procomm to transmit "u" for upload. but have been unable to do this, does anyone know an easy way?
can i get rid of iDaysAgo and just put a 7 in there??
func XDaysAgo : string
param integer iDaysAgo
integer iDay, iMonth, iYear, iHour, iMin, iSec
long lDate
string sDate
lDate = $LTIME - (86400 * iDaysAgo)
;Derive timeval for specified num. of days ago
ltimeints lDate iYear iMonth iDay iHour iMin iSec ;Convert timeval to integer components
strfmt sDate "%02d%02d%d" iMonth iDay iYear ;Create MMDDYYYY string
strdelete sDate 4 2 ;Delete first two numbers from year value
return sDate
sorry for the mess let me know if you have any ideas!
thanks again