jeff
Full Member
Posts: 15
|
Post by jeff on Aug 27, 2020 4:34:01 GMT
Is there a way to set an integer variable to time in seconds/mins?
I am trying to create a loop that would continue for a given amount of time. I figured the easiest way to achieve this would be to set a variable to the current time + time to wait, run the loop, check to see if the new current time exceeds my saved time variable. Unfortunately, it seems like the %TIME% variable is a string which wouldn't work for me.
|
|
|
Post by Steve on Aug 27, 2020 9:18:24 GMT
Have you considered using the other %time% variables such as %time_s% for the seconds or %time_m% for the minutes?
|
|
jeff
Full Member
Posts: 15
|
Post by jeff on Sept 7, 2020 9:43:05 GMT
I saw the %TIME_MACRO% variable and thought it would work perfectly in the following way:
1 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::3 2 | RUN ACTION | WAIT SECONDS | 1 7 | IF | INTEGER VARIABLE | %TIME_MACRO% | < | %INTEGER% | GOTO MACRO LINE | 2 This works fine, but when the time gets above 60 seconds %TIME_MACRO% variable turns into a string. Is there a way to get the time as seconds or similar integer value to use for my comparison?
|
|
|
Post by Steve on Sept 9, 2020 6:24:38 GMT
Hi Jeff,
I had a play around to see if I could come up with something but it gets real complicated with multiple lines. One way I can think of is to write it out to file and run something in batch to extract the time value back into a variable. But that's not a great solution. You've given me an idea for another internal variable though. %time_macro_seconds%, %time_macro_minutes%, and %time_macro_hours%. I'll add them to the list for the next update.
|
|
jeff
Full Member
Posts: 15
|
Post by jeff on Sept 11, 2020 5:44:46 GMT
Yeah, I also thought about exporting/importing the time via another language, but didn't want to go down that route due to the extra hassle. I ended up setting hard coded FOR loops with exporting the time for each completion to review and adjust as needed when I make changes. It is working good enough for now.
|
|