Hello,
I have something wrong that I know is so simple... anyone feel like helping out? I had this working last night, made a minor change, and now it's not working again. Here it goes though...
Readln>c:\test\hit_time.txt,1,time
Let>start=time-3
Let>end=time+3
Message>start time is %start% and end time is %end%
ok.. the script above needs to read a time stamp from a txt file, then subtract 3 to create a value for the variable "start", then add 3 to create a value for the variable "end". I keep getting the value back as "time-3" instead of 12:16
something simple
Moderators: JRL, Dorian (MJT support)
Looks like you're not getting a value from the text file. In the editor open up the watch list and step through the script with debug to see what value time is set to. Or add the following line after the ReadLn line:
MessageModal>time
In any case you won't be able to add or subtract using Let if time is a string. If it is a valid date/time then you can use Add and Sub. Most likely it is a string and you will need to retrieve the hour and minute parts of the time and manipulate that way, or, preferably, use the VBScript time functions.
MessageModal>time
In any case you won't be able to add or subtract using Let if time is a string. If it is a valid date/time then you can use Add and Sub. Most likely it is a string and you will need to retrieve the hour and minute parts of the time and manipulate that way, or, preferably, use the VBScript time functions.
MJT Net Support
[email protected]
[email protected]
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Dont's know format of what is in hit_time.txt, but have you tried this:
Also make sure you have removed all Trailing Spaces.Readln>c:\test\hit_time.txt,1,time
Let>start=%time%-3
Let>end=%time%+3
Message>start time is %start% and end time is %end%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!